Re: [PATCH v4 5/7] mm/khugepaged: Refactor the PTE state checks into a helper

"David Hildenbrand (Arm)" <[email protected]>
Newsgroups org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
On 8/12/26 11:51, David Hildenbrand (Arm) wrote:
>> Huh, that looks odd.
>>
>> That should just be a VM_WARN_ON_FOLIO(true, ..) or sth like that.
>>
>> But in collapse_scan_pmd() that warning never existed? So this raises eyebrows.
>>
>> [...]
>>
>> I'll play with it to see if we can do better and will reply here later.
> 
> 
> Okay, I think below is what we should do.
> 
> There is one behavioral change: we now longer trace the last folio, which is the right
> thing to do IMHO.
> 
> And I think there is one fix we should pull out and evaluate first: A zeropage with a
> uffd-wp marker is not checked properly, IIUC.

I took a closer look. It actually works as expected already, as max_ptes_none is
0 with uffd, and that will include the zeropage.

So we can move the uffd-wp checks into their old place.

(I think I raised before that the max_ptes_none handling with uffd-wp is
actually a bit off. In general, the uffd handling is weird, because even in
missing mode we can collapse shared zeropages just fine)

-- 
Cheers,

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.