Skip to content

RFC mm: process_mrelease: expedited reclaim and auto-kill support

Minchan Kim linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 27 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm: process_mrelease: expedite clean file folio reclaim via mmu_gatherarch/s390/include/asm/tlb.h include/linux/swap.h mm/mmu_gather.c +1 more+29 -92 replies
2/3mm: process_mrelease: skip LRU movement for exclusive file foliosmm/memory.c+12 -12 replies
3/3mm: process_mrelease: introduce PROCESS_MRELEASE_REAP_KILL flaginclude/uapi/asm-generic/siginfo.h include/uapi/linux/mman.h kernel/signal.c +1 more+33 -17 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/3] mm: process_mrelease: expedited reclaim and auto-kill support

This patch series introduces optimizations to expedite memory reclamation in process_mrelease() and provides a secure, race-free "auto-kill" mechanism for efficient container shutdown and OOM handling.

Currently, process_mrelease() unmaps pages but leaves clean file folios on the LRU list, relying on standard memory reclaim to eventually free them. Furthermore, requiring userspace to send a SIGKILL prior to invoking process_mrelease() introduces scheduling race conditions where the victim task may enter the exit path prematurely, bypassing expedited reclamation hooks.

This series addresses these limitations in three logical steps.

Patch #1: mm: process_mrelease: expedite clean file folio reclaim via mmu_gather Integrates clean file folio eviction directly into the low-level TLB batching (mmu_gather) infrastructure. Symmetrically truncates clean file folios alongside anonymous pages during the unmap loop.

Patch #2: mm: process_mrelease: skip LRU movement for exclusive file folios Skips costly LRU marking (folio_mark_accessed) for exclusive file-backed folios undergoing process_mrelease reclaim. Perf profiling reveals that LRU movement accounts for ~55% of overhead during unmap.

Patch #3: mm: process_mrelease: introduce PROCESS_MRELEASE_REAP_KILL flag Adds an auto-kill flag supporting atomic teardown. Utilizes a dedicated signal code (KILL_MRELEASE) to guarantee MMF_UNSTABLE is marked in the signal delivery path, preventing scheduling races.

Minchan Kim (3):
mm: process_mrelease: expedite clean file folio reclaim via mmu_gather
mm: process_mrelease: skip LRU movement for exclusive file folios
mm: process_mrelease: introduce PROCESS_MRELEASE_REAP_KILL flag

 arch/s390/include/asm/tlb.h        |  2 +-
 include/linux/swap.h               |  9 ++++++---
 include/uapi/asm-generic/siginfo.h |  6 ++++++
 include/uapi/linux/mman.h          |  4 ++++
 kernel/signal.c                    |  4 ++++
 mm/memory.c                        | 13 ++++++++++++-
 mm/mmu_gather.c                    |  8 +++++---
 mm/oom_kill.c                      | 20 +++++++++++++++++++-
 mm/swap_state.c                    | 19 +++++++++++++++++--
 9 files changed, 74 insertions(+), 11 deletions(-)
Signature · 1 line
2.54.0.rc0.605.g598a273b03-goog