Re: [PATCH v4 04/12] mm/memory: Batch set uffd-wp markers during zapping
From: David Hildenbrand (Arm)
Date: Tue Jul 07 2026 - 09:59:32 EST
On 6/27/26 11:00, Dev Jain wrote:
>
>
> On 23/06/26 3:31 pm, Dev Jain wrote:
>>
>>
>> On 16/06/26 7:13 pm, David Hildenbrand (Arm) wrote:
>>>
>>> Avoid talking about "next patch". Phrase it as "In preparation for batching...".
>>>
>>>
>>> Below you have
>>>
>>>
>>> Could we easily extend set_ptes() to allow for non-present -> non-present with
>>> nr > 1?
>>
>> We could have a set_nonpresent_ptes() in general, but then for some non-present
>> configs like in this patch, we don't need to change the pfn, while in some
>> configs like setting swp ptes in one go (like I do in later patches) we have
>> an underlying pfn. So I don't see an obvious simplification with a common
>> helper for non-present -> non-present for nr > 1.
>
> I think a "non-present" entry always means a softleaf? In that case, we can
> simply branch on softleaf_has_pfn().
We could, but it might turn the overall function more expensive by throwing in
additional runtime checks that the compiler will not really optimize out. Worth
playing with.
--
Cheers,
David