mm: rework handling in do_wp_page() based on private vs. shared mappings
authorDavid Hildenbrand <david@redhat.com>
Wed, 16 Nov 2022 10:26:45 +0000 (11:26 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 30 Nov 2022 23:58:57 +0000 (15:58 -0800)
commitb9086fde6d44e8a95dc95b822bd87386129b832d
treeaa38241e6c58937ad107774944d0710b95a96fff
parent79881fed6052a9ce00cfb63297832b9faacf8cf3
mm: rework handling in do_wp_page() based on private vs. shared mappings

We want to extent FAULT_FLAG_UNSHARE support to anything mapped into a
COW mapping (pagecache page, zeropage, PFN, ...), not just anonymous pages.
Let's prepare for that by handling shared mappings first such that we can
handle private mappings last.

While at it, use folio-based functions instead of page-based functions
where we touch the code either way.

Link: https://lkml.kernel.org/r/20221116102659.70287-7-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory.c