linux-stable/arch/s390/mm
Suren Baghdasaryan 49b0638502 mm: enable page walking API to lock vmas during the walk
walk_page_range() and friends often operate under write-locked mmap_lock. 
With introduction of vma locks, the vmas have to be locked as well during
such walks to prevent concurrent page faults in these areas.  Add an
additional member to mm_walk_ops to indicate locking requirements for the
walk.

The change ensures that page walks which prevent concurrent page faults
by write-locking mmap_lock, operate correctly after introduction of
per-vma locks.  With per-vma locks page faults can be handled under vma
lock without taking mmap_lock at all, so write locking mmap_lock would
not stop them.  The change ensures vmas are properly locked during such
walks.

A sample issue this solves is do_mbind() performing queue_pages_range()
to queue pages for migration.  Without this change a concurrent page
can be faulted into the area and be left out of migration.

Link: https://lkml.kernel.org/r/20230804152724.3090321-2-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Suggested-by: Linus Torvalds <torvalds@linuxfoundation.org>
Suggested-by: Jann Horn <jannh@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michel Lespinasse <michel@lespinasse.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-08-21 13:07:20 -07:00
..
Makefile s390/kasan: move shadow mapping to decompressor 2023-03-20 11:02:51 +01:00
cmm.c s390: simplify one level sysctl registration for cmm_table 2023-03-20 10:56:49 +01:00
dump_pagetables.c s390/mm,ptdump: avoid Kasan vs Memcpy Real markers swapping 2023-01-31 18:56:36 +01:00
extable.c s390/extable: add EX_TABLE_UA_LOAD_REGPAIR() macro 2022-11-21 13:36:15 +01:00
extmem.c Revert "s390/mm: get rid of VMEM_MAX_PHYS macro" 2023-07-04 07:46:26 +02:00
fault.c s390/mm: fix per vma lock fault handling 2023-07-18 15:34:51 +02:00
gmap.c mm: enable page walking API to lock vmas during the walk 2023-08-21 13:07:20 -07:00
hugetlbpage.c mm: move 'mmap_min_addr' logic from callers into vm_unmapped_area() 2023-04-21 14:52:05 -07:00
init.c s390/mm: use set_memory_*() helpers instead of open coding 2023-04-13 17:36:26 +02:00
maccess.c s390: include linux/io.h instead of asm/io.h 2023-07-03 11:19:40 +02:00
mmap.c mm: move 'mmap_min_addr' logic from callers into vm_unmapped_area() 2023-04-21 14:52:05 -07:00
page-states.c s390/mm: remove unused get_page_state() function 2022-11-23 16:24:07 +01:00
pageattr.c procfs: consolidate arch_report_meminfo declaration 2023-05-17 09:24:49 +02:00
pgalloc.c s390/mm: make use of atomic_fetch_xor() 2023-03-20 11:12:49 +01:00
pgtable.c s390: allow pte_offset_map_lock() to fail 2023-06-19 16:19:09 -07:00
vmem.c Revert "s390/mm: get rid of VMEM_MAX_PHYS macro" 2023-07-04 07:46:26 +02:00