* [RFC] Proposal: Kernel-supported mechanism for shared memory state cleanup on exit
@ 2025-12-20 1:07 Yongfeng Wang
0 siblings, 0 replies; only message in thread
From: Yongfeng Wang @ 2025-12-20 1:07 UTC (permalink / raw)
To: akpm; +Cc: linux-mm
Hi Andrew Morton,
I’m looking for your feedback on a gap in the current synchronization
primitives: the lack of a general, kernel-supported mechanism to clean
up user-space shared memory state (e.g., refcounts, ownership flags)
when a process exits unexpectedly (SIGKILL/crash).
The Problem: While robust_list handles mutexes and SEM_UNDO handles
System V semaphores, there is no generic way to perform simple,
reversible operations (like clearing a bit or decrementing a counter)
on arbitrary shared memory upon process death. User-space recovery is
often unreliable in crash scenarios.
The Idea: A syscall or prctl extension allowing a process to register
a limited number of "deferred actions" on shared memory addresses.
Target: Small, management-plane state.
Operations: Atomic write/add/clear.
Execution: Handled by the kernel during do_exit(), ensuring atomicity
even if the process is killed.
Questions:
Do you see this as a problem worth solving at the kernel level, or
should this remain strictly in user-space?
Are there fundamental architectural blockers (e.g., page fault
handling during do_exit) that make this impractical?
I have a more detailed technical draft ready if this is a direction
you’d consider.
Best regards,
Yongfeng Wang
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-20 1:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-20 1:07 [RFC] Proposal: Kernel-supported mechanism for shared memory state cleanup on exit Yongfeng Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox