mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Li Zhe <lizhe.67@bytedance.com>,
	"Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Cc: "Jose A. Perez de Azpillaga" <azpijr@gmail.com>,
	akpm@linux-foundation.org, muchun.song@linux.dev,
	osalvador@suse.de, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hugetlb: avoid recursive i_mmap_rwsem in PMD sharing
Date: Sat, 10 Oct 2026 15:18:52 +0200	[thread overview]
Message-ID: <ba74de67-a687-4ccb-830a-ed018d4f66ee@kernel.org> (raw)
In-Reply-To: <ab1577d2-a9ce-41db-a632-8e25652dab31@bytedance.com>

On 10/10/26 08:37, Li Zhe wrote:
> On 10/10/26 2:05 AM, David Hildenbrand (Arm) wrote:
>> On 10/9/26 13:52, Lorenzo Stoakes (ARM) wrote:
>>> Yeah I don't see why not! I don't think there's anything that needs to be
>>> private here.
>> Li, see below, can you work with the below?
> 
> 
> Thanks for the patch. I tested it with my original mremap reproducer, and
> I can no longer reproduce the hung task.
> 
> I also checked the hugetlb_change_protection() / uffd-wp path Jose
> mentioned. That path can reach hugetlb_change_protection() and
> huge_pte_alloc(), but it does not enter huge_pmd_share(), because
> VM_UFFD_WP makes want_pmd_share() return false via
> uffd_disable_huge_pmd_share().
> 
> My understanding of your patch is that we preallocate the destination
> hugetlb page tables before taking the mapping's i_mmap_rwsem in write
> mode. Then, while holding i_mmap_rwsem, we only walk the preallocated
> destination PTEs and move the source huge PTEs over. This avoids calling
> huge_pte_alloc(), and therefore huge_pmd_share(), while already holding
> i_mmap_rwsem for write.
> 
> Does that match your intended direction? If so, I will go through the
> details and make sure there are no issues, then send a v2 based on this
> approach.

Yes, please. make sure to keep Lorenzo's SOB/authorship. If you perform
modifications (patch/commit message) add your co-developed-by + SOB when sending
it out.

-- 
Cheers,

David

  reply	other threads:[~2026-10-10 13:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30  6:43 Li Zhe
2026-09-30  9:31 ` Jose A. Perez de Azpillaga
2026-10-05  9:03   ` Li Zhe
2026-10-05  9:25     ` David Hildenbrand (Arm)
2026-10-09 11:52       ` Lorenzo Stoakes (ARM)
2026-10-09 18:05         ` David Hildenbrand (Arm)
2026-10-10  6:37           ` Li Zhe
2026-10-10 13:18             ` David Hildenbrand (Arm) [this message]
2026-09-30 10:03 ` David Hildenbrand (Arm)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba74de67-a687-4ccb-830a-ed018d4f66ee@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=azpijr@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizhe.67@bytedance.com \
    --cc=ljs@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=osalvador@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®