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

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

From: Andy Lutomirski <luto@amacapital.net>
Date: 2024-01-31 18:12:07
Also in: lkml

On Mon, Jan 29, 2024 at 3:24 AM Oleg Nesterov [off-list ref] wrote:
On 01/27, Oleg Nesterov wrote:
quoted
I'll (hopefully) send v2 on top of

      pidfd: cleanup the usage of __pidfd_prepare's flags
      pidfd: don't do_notify_pidfd() if !thread_group_empty()

on Monday
Sorry, I don't have time to finish v2 today, I need to update the comments
and write the changelog.

But the patch itself is ready, I am sending it for review.

Tycho, Christian, any comments?
Right now, pidfd_send_signal() sends signals to processes, like so:

 * The syscall currently only signals via PIDTYPE_PID which covers
 * kill(<positive-pid>, <signal>. It does not signal threads or process
 * groups.

This patch adds PIDFD_THREAD which, potentially confusingly, doesn't
change this (AFAICS).  So at least that should be documented loudly
and clearly, IMO.  But I actually just bumped in to this limitation in
pidfd_send_signal(), like so:

https://github.com/systemd/systemd/issues/31093

Specifically, systemd can't properly emulate Ctrl-C using pidfd_send_signal().

I don't know whether implementing the other signal types belongs as
part of this patch, but they're at least thematically related.

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