lkml.org 
[lkml]   [2021]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 06/11] mm: support GUP-triggered unsharing via FAULT_FLAG_UNSHARE (!hugetlb)
On Fri, Dec 17, 2021 at 12:39 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> At the time of such a shared pin, you can do what we already do:
> re-use the page if it has a refcount of 1. Or do an early COW event
> (feel free to avoid the "mark it writable and dirty").

Note that this also depends on fork() doing the right thing, marking
things for "a fork() can not share this page any more".

Which it does for regular pages, and is exactly what that
page_needs_cow_for_dma() logic is all about (and the special
write_protect_seq around gup/fork).

I do believe that huge-pages don't do it right. But I think that as
you try to fix hugepages, you are now breaking the normal case.

If all your logic was only about hugepages, I wouldn't care so much.
But you are playing questionable games with code that I think is
correct.

Please explain why.

Linus

\
 
 \ /
  Last update: 2021-12-17 21:53    [W:0.193 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site