Re: [PATCH 1/1] mm: introduce process_reap system call

From
Jan Engelhardt <hidden>
Date
2021-07-12 13:00:22
Also in
lkml
Reply to
Suren Baghdasaryan, 2021-07-08
On Thursday 2021-07-08 08:05, Suren Baghdasaryan wrote:
quoted
That explains very clearly the requirement, but it raises the question
why this isn't an si_code flag for rt_sigqueueinfo, reusing the existing
system call.
I think you are suggesting to use sigqueue() to deliver the signal and
perform the reaping when a special value accompanies it. This would be
somewhat similar to my early suggestion to use a flag in
pidfd_send_signal() (see:
https://lore.kernel.org/patchwork/patch/1060407) to implement memory
reaping which has another advantage of operation on PIDFDs instead of
PIDs which can be recycled.
kill()/pidfd_send_signal()/sigqueue() are supposed to deliver the
signal and return without blocking. Changing that behavior was
considered unacceptable in these discussions.
The way I understood the request is that a userspace program (or perhaps two,
if so desired) should issue _two_ calls, one to deliver the signal,
one to perform the reap portion:

	uinfo.si_code = SI_QUEUE;
	sigqueue(pid, SIGKILL, &uinfo);
	uinfo.si_code = SI_REAP;
	sigqueue(pid, SIGKILL, &uinfo);
Thread (5 messages) 5 messages, 3 authors, last reply 2021-07-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help