Re: [PATCH v1 06/11] mm: support GUP-triggered unsharing via FAULT_FLAG_UNSHARE (!hugetlb)

From
Matthew Wilcox <willy@infradead.org>
Date
2021-12-19 11:30:38
Also in
linux-kselftest, linux-mm, lkml
Reply to
John Hubbard, 2021-12-19
On Sun, Dec 19, 2021 at 12:01:59AM -0800, John Hubbard wrote:
On 12/18/21 22:02, Nadav Amit wrote:
quoted
I found my old messy code for the software-PTE thing.

I see that eventually I decided to hold a pointer to the “extra PTEs”
of each page in the PMD-page-struct. [ I also implemented the 2-adjacent
pages approach but this code is long gone. ]
a) The PMD-page-struct approach won't help as much, because (assuming
that we're using it in an attempt to get a true, perfect pin count), you
are combining the pin counts of a PMD's worth of pages. OTOH...maybe
that actually *is* OK, assuming you don't overflow--except that you can
only answer the "is it dma-pinned?" question at a PMD level. That's a
contradiction of your stated desire above to have very granular control.

Also, because of not having bit 0 available in page._pt_pad_1, I think
the count would have to be implemented as adding and subtracting 2,
instead of 1 (in order to keep the value even), further reducing the
counter range.
I think you misunderstood Nadav's approach.  He's talking about making
an extra side-allocation per PMD if you're using uffd, and storing
extra information in it.  I think it's a worthwile approach.
Thread (137 messages) 137 messages, 11 authors, last reply 2022-01-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help