Thread (44 messages) flat view 44 messages, 4 authors, 2024-02-01

Re: [RFC PATCH] pidfd: implement PIDFD_THREAD flag for pidfd_open()

From: Oleg Nesterov <oleg@redhat.com>
Date: 2024-01-30 11:22:48
Also in: lkml

On 01/29, Christian Brauner wrote:
On Mon, Jan 29, 2024 at 12:23:15PM +0100, Oleg Nesterov wrote:
quoted
@@ -3926,6 +3927,7 @@ SYSCALL_DEFINE4(pidfd_send_signal, int, pidfd, int, sig,
 		prepare_kill_siginfo(sig, &kinfo);
 	}

+	/* TODO: respect PIDFD_THREAD */
So I've been thinking about this at the end of last week. Do we need to
give userspace a way to send a thread-group wide signal even when a
PIDFD_THREAD pidfd is passed? Or should we just not worry about this
right now and wait until someone needs this?
I don't know. I am fine either way, but I think this needs a separate
patch and another discussion in any case. Anyway should be trivial,
pidfd_send_signal() has the "flags" argument.

On a related note, should copy_process(CLONE_PIDFD | CLONE_THREAD) add
PIDFD_THREAD flag "automatically" depending on CLONE_THREAD? Or do we
want another CLONE_PIDFD_THREAD flag so that PIDFD_THREAD can be used
without CLONE_THREAD? Again, I do not know, needs another discussion.
Otherwise this looks good to me!
OK, thanks, I'll send v2 in a minute. The patch is the same, I only
updated the comments.

Oleg.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help