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

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
2021-12-17 20:51:43
Also in
linux-kselftest, linux-mm, lkml
Reply to
David Hildenbrand, 2021-12-17
On Fri, Dec 17, 2021 at 12:45 PM David Hildenbrand [off-list ref] wrote:
If a page is mapped exactly once, page_mapcount(page) == 1 and there is
nothing to do.
Why?

You state that, but you stating that doesn't magically make it so.

What makes "mapcount==1" stable and special? Your "it's an
atomic_read()" argument is nonsense - it implies that the count can be
changing, but you will get _one_ answer.

What makes that one answer of a changing count special?

What if there are other references to that same page, gotten with
vmsplice(), and just about to be mapped into another address space?

This is the meat of my argument. You claim that "mapcount==1" is
special. I claim that you haven't explained why it would be. And I do
not believe it is.

                 Linus
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