linux-stable/arch/s390
Suren Baghdasaryan a55dd240a9 mm: enable page walking API to lock vmas during the walk
commit 49b0638502 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-30 14:52:36 +02:00
..
appldata s390: simplify dynamic sysctl registration for appldata_register_ops 2023-03-20 10:56:49 +01:00
boot s390/mm: fix direct map accounting 2023-04-13 17:36:28 +02:00
configs s390/iommu: get rid of S390_CCW_IOMMU and S390_AP_IOMMU 2023-05-17 15:20:18 +02:00
crypto s390/crypto: use vector instructions only if available for ChaCha20 2023-05-15 14:20:13 +02:00
hypfs
include s390/uapi: cover statfs padding by growing f_spare 2023-05-17 15:20:17 +02:00
kernel KVM: s390: fix sthyi error handling 2023-08-11 12:14:08 +02:00
kvm KVM: s390: fix sthyi error handling 2023-08-11 12:14:08 +02:00
lib s390/lib: use SYM* macros instead of ENTRY(), etc. 2023-04-19 17:24:16 +02:00
mm mm: enable page walking API to lock vmas during the walk 2023-08-30 14:52:36 +02:00
net bpf-next-for-netdev 2023-04-21 20:32:37 -07:00
pci Merge branch 'uaccess-inline-asm-cleanup' into features 2023-04-04 18:29:28 +02:00
purgatory s390/purgatory: disable branch profiling 2023-06-01 16:59:43 +02:00
tools
Kbuild
Kconfig s390/iommu: get rid of S390_CCW_IOMMU and S390_AP_IOMMU 2023-05-17 15:20:18 +02:00
Kconfig.debug
Makefile s390/decompressor: fix misaligned symbol build error 2023-07-23 13:54:08 +02:00