Thread (137 messages) 137 messages, 11 authors, 2022-01-04

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 22:26:28
Also in: linux-kselftest, linux-mm, lkml

On Sun, Dec 19, 2021 at 02:12:04PM -0800, Linus Torvalds wrote:
On Sun, Dec 19, 2021 at 2:02 PM Matthew Wilcox [off-list ref] wrote:
quoted
I'd like to get rid of ->mapcount for file pages too.  And those are
definitely never mapped in the majority of cases.
Fair enough.

You'd probably be better off checking "is this mapping mapped" though.
Because otherwise you have to get the page lock to serialize each
page.
Truncate already has the page locked, eg
truncate_inode_pages_range()
  find_lock_entries()
  truncate_cleanup_page()
    if (page_mapped(page))
      unmap_mapping_page(page)

I think anyone calling unmap_mapping_page() really ought to have the
page lock.  Oh, we actually have an assert already to that effect ;-)
        VM_BUG_ON(!PageLocked(page));
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help