[merged mm-nonmm-stable] ipc-only-destroy-orphaned-shm-segments-on-sysctl-write.patch removed from -mm tree
Andrew Morton <[email protected]>
| Newsgroups | org.kernel.vger.mm-commits |
|---|---|
| Message-ID | <[email protected]> |
The quilt patch titled
Subject: ipc: only destroy orphaned shm segments on sysctl write
has been removed from the -mm tree. Its filename was
ipc-only-destroy-orphaned-shm-segments-on-sysctl-write.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Jianlin Shi <[email protected]>
Subject: ipc: only destroy orphaned shm segments on sysctl write
Date: Mon, 15 Jun 2026 10:27:41 +0800
proc_ipc_dointvec_minmax_orphans() currently calls shm_destroy_orphaned()
whenever shm_rmid_forced is set, including on sysctl reads. Reading
/proc/sys/kernel/shm_rmid_forced should not take shm_ids rwsem for write
and walk all segments.
Only run the cleanup when the sysctl is written and the forced RMID policy
is enabled.
When shm_rmid_forced=1, monitoring tools that read
/proc/sys/kernel/shm_rmid_forced trigger the cleanup on every read.
Link: https://lore.kernel.org/all/?q=only+destroy+orphaned+shm+segments+on+sysctl+write
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Jianlin Shi <[email protected]>
Acked-by: Davidlohr Bueso <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---
ipc/ipc_sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/ipc/ipc_sysctl.c~ipc-only-destroy-orphaned-shm-segments-on-sysctl-write
+++ a/ipc/ipc_sysctl.c
@@ -28,7 +28,7 @@ static int proc_ipc_dointvec_minmax_orph
if (err < 0)
return err;
- if (ns->shm_rmid_forced)
+ if (write && ns->shm_rmid_forced)
shm_destroy_orphaned(ns);
return err;
}
_
Patches currently in -mm which might be from [email protected] are
mm-page_alloc-only-update-lowmem_reserve_ratio-on-sysctl-write.patch