linux-stable/arch/powerpc/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
..
book3s32 powerpc/32s: Fix LLVM SMP build 2023-06-14 12:46:42 +10:00
book3s64 mm: enable page walking API to lock vmas during the walk 2023-08-21 13:07:20 -07:00
kasan powerpc/kasan: Disable KCOV in KASAN code 2023-07-17 22:49:44 +10:00
nohash powerpc/nohash: Fix build with llvm-as 2023-02-16 23:53:15 +11:00
ptdump powerpc: Remove CONFIG_PPC_BOOK3E_MMU 2022-09-26 23:00:14 +10:00
Makefile powerpc/mm: Convert to default topdown mmap layout 2022-05-05 22:11:58 +10:00
cacheflush.c powerpc: Fix all occurences of "the the" 2022-05-22 15:59:43 +10:00
copro_fault.c powerpc/mm: convert coprocessor fault to lock_mm_and_find_vma() 2023-06-24 14:12:58 -07:00
dma-noncoherent.c
drmem.c powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
fault.c powerpc/mm: Convert to using lock_mm_and_find_vma() 2023-06-24 14:12:58 -07:00
hugetlbpage.c powerpc/hugetlb: pte_alloc_huge() 2023-06-19 16:19:08 -07:00
init-common.c powerpc/kuep: Remove 'nosmep' boot time parameter except for book3s/64 2021-12-09 22:41:18 +11:00
init_32.c powerpc: Remove CONFIG_FSL_BOOKE 2022-09-26 22:47:37 +10:00
init_64.c powerpc/mm/dax: Fix the condition when checking if altmap vmemap can cross-boundary 2023-06-21 14:08:53 +10:00
ioremap.c powerpc: make memremap_compat_align 64s-only 2021-12-02 22:57:24 +11:00
ioremap_32.c powerpc/mm: Leave a gap between early allocated IO areas 2021-06-25 00:07:10 +10:00
ioremap_64.c powerpc/mm: Leave a gap between early allocated IO areas 2021-06-25 00:07:10 +10:00
maccess.c powerpc/inst: Optimise copy_inst_from_kernel_nofault() 2021-12-09 22:41:21 +11:00
mem.c powerpc/code-patching: Remove protection against patching init addresses after init 2022-12-02 21:59:57 +11:00
mmu_context.c powerpc/mm: Switch obsolete dssall to .long 2021-12-23 22:35:13 +11:00
mmu_decl.h powerpc/e500: Add missing prototype for 'relocate_init' 2023-02-20 17:04:01 +11:00
numa.c powerpc updates for 6.4 2023-04-28 16:24:32 -07:00
pageattr.c powerpc: align address to page boundary in change_page_attr() 2022-05-08 22:15:41 +10:00
pgtable-frag.c powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
pgtable.c powerpc/mm: move protection_map[] inside the platform 2022-07-17 17:14:37 -07:00
pgtable_32.c powerpc: move __end_rodata to cover arch read-only sections 2022-09-26 20:58:16 +10:00
pgtable_64.c powerpc: Remove asm/prom.h from all files that don't need it 2022-05-08 22:15:04 +10:00