From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Chris Down <chris@chrisdown.name>,
Andrew Morton <akpm@linux-foundation.org>,
Matthew Wilcox <willy@infradead.org>,
kernel-team@fb.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Zi Yan <ziy@nvidia.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Nico Pache <npache@redhat.com>,
Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>
Subject: Re: [PATCH v2 1/3] mm/huge_memory: Fix use of NULL folio in move_pages_huge_pmd()
Date: Mon, 2 Mar 2026 20:05:37 +0100 [thread overview]
Message-ID: <99bb6e08-2c70-4b52-8fbc-1233173fc195@kernel.org> (raw)
In-Reply-To: <479c691e-1330-462d-9d7d-25cfda1f190b@lucifer.local>
On 3/2/26 18:43, Lorenzo Stoakes wrote:
> On Mon, Mar 02, 2026 at 06:35:46PM +0100, David Hildenbrand (Arm) wrote:
>>
>>>
>>> I prefer my version at [0].
>>>
>>> Cleaner to actually pull out the zero_folio into a local variable, and also we
>>> should mark it special to be consistent with other codepaths.
>>
>> I argued in v1 that we should handle it similar to an ordinary move
>> during mremap()->move_huge_pmd() and not split it over two patches.
>>
>> It's still split over two patches, which doesn't make sense.
>
> Yes, let's not do that, I made the same comment.
>
>>
>> https://lore.kernel.org/linux-mm/0b653dcd-842b-4360-bc1c-8fe779efbc23@kernel.org/
>>
>> I don't think there is no need to get the folio involved at all if we
>> know that we have a well-prepared PMD (zero folio, makred as special).
>>
>> The less code we have that has to deal with setting PMDs special (and
>> possible messing it up), the better.
>
> Yup I agree, I replied accordingly. That's a more elegant thing than duplicating
> huge zero installation code.
>
> I had just assumed that there was _some reason_ why we wouldn't want to do that
> given the original patch from Suren didn't just do that, and for the sakes of a
> backport no need to think too deep on it.
>
> But you're right I don't think there's any reason we need to diverge from what
> mremap() would do.
>
> That does have:
>
> if (vma_has_uffd_without_event_remap(vma))
> pmd = clear_uffd_wp_pmd(pmd);
>
> Though rather than unconditonally invoking clear_uffd_wp_pmd().
>
> Is that correct?
My conclusion was that UFFDIO_MOVE will never move uffd-wp information
(just like we currently don't do for any moved PTEs).
mremap() might sometimes. But it also effectively moves all (most) uffd
VMA properties, so it has slightly different semantics.
--
Cheers,
David
next prev parent reply other threads:[~2026-03-02 19:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 14:15 Chris Down
2026-03-02 17:23 ` Lorenzo Stoakes
2026-03-02 17:35 ` David Hildenbrand (Arm)
2026-03-02 17:43 ` Lorenzo Stoakes
2026-03-02 19:05 ` David Hildenbrand (Arm) [this message]
2026-03-02 17:36 ` Lorenzo Stoakes
2026-03-02 17:39 ` 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=99bb6e08-2c70-4b52-8fbc-1233173fc195@kernel.org \
--to=david@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=chris@chrisdown.name \
--cc=dev.jain@arm.com \
--cc=kernel-team@fb.com \
--cc=lance.yang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=npache@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=stable@vger.kernel.org \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/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