lkml.org 
[lkml]   [2022]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 13/16] mm/gup: disallow follow_page(FOLL_PIN)
From
On 3/29/22 18:04, David Hildenbrand wrote:
> We want to change the way we handle R/O pins on anonymous pages that
> might be shared: if we detect a possibly shared anonymous page --
> mapped R/O and not !PageAnonExclusive() -- we want to trigger unsharing
> via a page fault, resulting in an exclusive anonymous page that can be
> pinned reliably without getting replaced via COW on the next write
> fault.
>
> However, the required page fault will be problematic for follow_page():
> in contrast to ordinary GUP, follow_page() doesn't trigger faults
> internally. So we would have to end up failing a R/O pin via
> follow_page(), although there is something mapped R/O into the page
> table, which might be rather surprising.
>
> We don't seem to have follow_page(FOLL_PIN) users, and it's a purely
> internal MM function. Let's just make our life easier and the semantics of
> follow_page() clearer by just disallowing FOLL_PIN for follow_page()
> completely.
>
> Signed-off-by: David Hildenbrand <david@redhat.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

\
 
 \ /
  Last update: 2022-04-14 17:59    [W:0.196 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site