Skip to content

mm: cleanups around unmapping / zapping

David Hildenbrand (Arm) bpf dri-devel intel-gfx kvm linux-fsdevel linux-mm linux-perf-users linux-rdma linux-s390 linux-sgx linuxppc-dev lkml netdev rust-for-linux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 43 repliesIn review 14 of 16 applied

Patches in v1 14 of 16 applied

#Subject and filesSizeRepliesApplied
1/16mm/madvise: drop range checks in madvise_free_single_vma()mm/madvise.c+4 -91 replyApplied
2/16mm/memory: remove "zap_details" parameter from zap_page_range_single()arch/s390/mm/gmap_helpers.c drivers/android/binder_alloc.c include/linux/mm.h +6 more+20 -2011 replies
3/16mm/memory: inline unmap_mapping_range_vma() into unmap_mapping_range_tree()mm/memory.c+7 -161 replyApplied
4/16mm/memory: simplify calculation in unmap_mapping_range_tree()include/linux/mm.h mm/interval_tree.c mm/memory.c+10 -122 repliesApplied
5/16mm/oom_kill: use MMU_NOTIFY_CLEAR in __oom_reap_task_mm()mm/oom_kill.c+1 -11 replyApplied
6/16mm/oom_kill: factor out zapping of VMA into zap_vma_for_reaping()mm/internal.h mm/memory.c mm/oom_kill.c+34 -221 replyApplied
7/16mm/memory: rename unmap_single_vma() to __zap_vma_range()mm/memory.c+3 -31 replyApplied
8/16mm/memory: move adjusting of address range to unmap_vmas()mm/memory.c+23 -351 replyApplied
9/16mm/memory: convert details->even_cows into details->skip_cowsinclude/linux/mm.h mm/madvise.c mm/memory.c+7 -82 repliesApplied
10/16mm/memory: use __zap_vma_range() in zap_vma_for_reaping()include/linux/mm.h mm/memory.c+10 -42 repliesApplied
11/16mm/memory: inline unmap_page_range() into __zap_vma_range()mm/memory.c+12 -204 replies
12/16mm: rename zap_vma_pages() to zap_vma()arch/powerpc/platforms/book3s/vas-api.c arch/powerpc/platforms/pseries/vas.c include/linux/mm.h +2 more+9 -51 replyApplied
13/16mm: rename zap_page_range_single_batched() to zap_vma_range_batched()mm/internal.h mm/madvise.c mm/memory.c+16 -141 replyApplied
14/16mm: rename zap_page_range_single() to zap_vma_range()arch/s390/mm/gmap_helpers.c drivers/android/binder/page_range.rs drivers/android/binder_alloc.c +7 more+22 -224 repliesApplied
15/16mm: rename zap_vma_ptes() to zap_special_vma_range()arch/x86/kernel/cpu/sgx/encl.c drivers/comedi/comedi_fops.c drivers/gpu/drm/i915/i915_mm.c +4 more+16 -183 repliesApplied
16/16mm/memory: support VM_MIXEDMAP in zap_special_vma_range()mm/memory.c+2 -26 repliesApplied

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by.

PatchAlice RyhlLeon RomanovskyLorenzo Stoakes (Oracle)Puranjay Mohan
1/16R-b
2/16A-b R-b A-b
3/16R-b
4/16R-b
5/16R-b
6/16R-b
7/16R-b
8/16R-b
9/16R-b
10/16R-b
11/16R-b
12/16R-b
13/16R-b
14/16A-b R-b A-b
15/16A-b R-b
16/16R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH v1 00/16] mm: cleanups around unmapping / zapping

A bunch of cleanups around unmapping and zapping. Mostly simplifications, code movements, documentation and renaming of zapping functions.

With this series, we'll have the following high-level zap/unmap functions (excluding high-level folio zapping):
* unmap_vmas() for actual unmapping (vmas will go away)
* zap_vma(): zap all page table entries in a vma
* zap_vma_for_reaping(): zap_vma() that must not block
* zap_vma_range(): zap a range of page table entries
* zap_vma_range_batched(): zap_vma_range() with more options and batching
* zap_special_vma_range(): limited zap_vma_range() for modules
* __zap_vma_range(): internal helper

Patch #1 is not about unmapping/zapping, but I stumbled over it while verifying MADV_DONTNEED range handling.

Patch #16 is related to [1], but makes sense even independent of that.

[1] https://lore.kernel.org/r/[email protected]

The CC list is already long enough. As these are simple changes to drivers/arch code, I'm only CCing maintainers of all changes but only reviewers of the MM bits.

Cc Andrew Morton <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc "Liam R. Howlett" <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Jann Horn <[email protected]>
Cc Pedro Falcato <[email protected]>
Cc David Rientjes <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc "Matthew Wilcox (Oracle)" <[email protected]>
Cc Alice Ryhl <[email protected]>
Cc Madhavan Srinivasan <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Janosch Frank <[email protected]>
Cc Claudio Imbrenda <[email protected]>
Cc Alexander Gordeev <[email protected]>
Cc Gerald Schaefer <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Jarkko Sakkinen <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc "Arve Hjønnevåg" <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Carlos Llamas <[email protected]>
Cc Alice Ryhl <[email protected]>
Cc Ian Abbott <[email protected]>
Cc H Hartley Sweeten <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc David Airlie <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Leon Romanovsky <[email protected]>
Cc Dimitri Sivanich <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Alexei Starovoitov <[email protected]>
Cc Daniel Borkmann <[email protected]>
Cc Andrii Nakryiko <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Vincenzo Frascino <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Neal Cardwell <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc David Ahern <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
Cc Miguel Ojeda <[email protected]>

David Hildenbrand (Arm) (16):
mm/madvise: drop range checks in madvise_free_single_vma() mm/memory: remove "zap_details" parameter from zap_page_range_single() mm/memory: inline unmap_mapping_range_vma() into
unmap_mapping_range_tree()
mm/memory: simplify calculation in unmap_mapping_range_tree() mm/oom_kill: use MMU_NOTIFY_CLEAR in __oom_reap_task_mm() mm/oom_kill: factor out zapping of VMA into zap_vma_for_reaping() mm/memory: rename unmap_single_vma() to __zap_vma_range() mm/memory: move adjusting of address range to unmap_vmas() mm/memory: convert details->even_cows into details->skip_cows mm/memory: use __zap_vma_range() in zap_vma_for_reaping() mm/memory: inline unmap_page_range() into __zap_vma_range()
mm: rename zap_vma_pages() to zap_vma()
mm: rename zap_page_range_single_batched() to zap_vma_range_batched()
mm: rename zap_page_range_single() to zap_vma_range()
mm: rename zap_vma_ptes() to zap_special_vma_range() mm/memory: support VM_MIXEDMAP in zap_special_vma_range()

 arch/powerpc/platforms/book3s/vas-api.c |   2 +-
 arch/powerpc/platforms/pseries/vas.c    |   2 +-
 arch/s390/mm/gmap_helpers.c             |   2 +-
 arch/x86/kernel/cpu/sgx/encl.c          |   2 +-
 drivers/android/binder/page_range.rs    |   4 +-
 drivers/android/binder_alloc.c          |   2 +-
 drivers/comedi/comedi_fops.c            |   2 +-
 drivers/gpu/drm/i915/i915_mm.c          |   4 +-
 drivers/infiniband/core/uverbs_main.c   |   6 +-
 drivers/misc/sgi-gru/grumain.c          |   2 +-
 include/linux/mm.h                      |  23 ++-
 kernel/bpf/arena.c                      |   3 +-
 kernel/events/core.c                    |   2 +-
 lib/vdso/datastore.c                    |   2 +-
 mm/internal.h                           |   7 +-
 mm/interval_tree.c                      |   5 -
 mm/madvise.c                            |  24 +--
 mm/memory.c                             | 217 ++++++++++++------------
 mm/oom_kill.c                           |  15 +-
 mm/page-writeback.c                     |   2 +-
 net/ipv4/tcp.c                          |   7 +-
 rust/kernel/mm/virt.rs                  |   4 +-
 22 files changed, 162 insertions(+), 177 deletions(-)

base-commit: df9c51269a5e2a6fbca2884a756a4011a5e78748

Signature · 1 line
2.43.0