From: Minchan Kim <minchan@kernel.org>
To: akpm@linux-foundation.org
Cc: david@kernel.org, mhocko@suse.com, brauner@kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
surenb@google.com, timmurray@google.com,
Minchan Kim <minchan@kernel.org>
Subject: [RFC 0/3] mm: process_mrelease: expedited reclaim and auto-kill support
Date: Mon, 13 Apr 2026 15:39:45 -0700 [thread overview]
Message-ID: <20260413223948.556351-1-minchan@kernel.org> (raw)
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(-)
--
2.54.0.rc0.605.g598a273b03-goog
next reply other threads:[~2026-04-13 22:39 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 22:39 Minchan Kim [this message]
2026-04-13 22:39 ` [RFC 1/3] mm: process_mrelease: expedite clean file folio reclaim via mmu_gather Minchan Kim
2026-04-14 7:45 ` David Hildenbrand (Arm)
2026-04-14 20:21 ` Minchan Kim
2026-04-13 22:39 ` [RFC 2/3] mm: process_mrelease: skip LRU movement for exclusive file folios Minchan Kim
2026-04-14 7:20 ` David Hildenbrand (Arm)
2026-04-14 20:22 ` Minchan Kim
2026-04-13 22:39 ` [RFC 3/3] mm: process_mrelease: introduce PROCESS_MRELEASE_REAP_KILL flag Minchan Kim
2026-04-16 9:13 ` Christian Brauner
2026-04-17 6:30 ` Minchan Kim
2026-04-17 7:04 ` Michal Hocko
2026-04-20 21:47 ` Minchan Kim
2026-04-23 7:17 ` Michal Hocko
2026-04-23 23:43 ` Minchan Kim
2026-04-24 7:38 ` Michal Hocko
2026-04-14 6:57 ` [RFC 0/3] mm: process_mrelease: expedited reclaim and auto-kill support Michal Hocko
2026-04-14 20:00 ` Minchan Kim
2026-04-15 7:38 ` Michal Hocko
2026-04-15 23:26 ` Minchan Kim
2026-04-16 6:54 ` Michal Hocko
2026-04-17 6:20 ` Minchan Kim
2026-04-17 7:11 ` Michal Hocko
2026-04-20 21:53 ` Minchan Kim
2026-04-23 7:50 ` Michal Hocko
2026-04-23 9:49 ` David Hildenbrand (Arm)
2026-04-23 22:36 ` Suren Baghdasaryan
2026-04-24 0:08 ` Minchan Kim
2026-04-24 7:40 ` Michal Hocko
2026-04-24 7:41 ` David Hildenbrand (Arm)
2026-04-27 16:14 ` Suren Baghdasaryan
2026-04-23 23:58 ` Minchan Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260413223948.556351-1-minchan@kernel.org \
--to=minchan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=david@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=surenb@google.com \
--cc=timmurray@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.