lkml.org 
[lkml]   [2024]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mm/memory: Fix missing pte marker for !page on pte zaps
From
On 13.03.24 23:03, David Hildenbrand wrote:
> On 13.03.24 22:31, peterx@redhat.com wrote:
>> From: Peter Xu <peterx@redhat.com>
>>
>> Commit 0cf18e839f64 of large folio zap work broke uffd-wp. Now mm's uffd
>> unit test "wp-unpopulated" will trigger this WARN_ON_ONCE().
>
> Good that I added the WARN_ON_ONCE() :)
>
>>
>> The WARN_ON_ONCE() asserts that an VMA cannot be registered with
>> userfaultfd-wp if it contains a !normal page, but it's actually possible.
>> One example is an anonymous vma, register with uffd-wp, read anything will
>> install a zero page. Then when zap on it, this should trigger.
>
> Are you sure? zap_install_uffd_wp_if_needed() contains right at the start:
>
> /* Zap on anonymous always means dropping everything */
> if (vma_is_anonymous(vma))
> return;
>
> So if that's the case the unit test triggers, I'm confused.


Ah, got it. It's not that we have to place a marker, just that it can
happen. Of course it can. All makes sense.

Thanks!

--
Cheers,

David / dhildenb


\
 
 \ /
  Last update: 2024-03-13 23:26    [W:0.052 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site