Re: [PATCH RFC v3 2/4] pidfd: add CLONE_PIDFD_AUTOKILL

From: Christian Brauner

Date: Wed Feb 18 2026 - 08:33:15 EST


On Wed, Feb 18, 2026 at 12:50:41PM +0100, Oleg Nesterov wrote:
> On 02/17, Christian Brauner wrote:
> >
> > @@ -2470,8 +2479,11 @@ __latent_entropy struct task_struct *copy_process(
> > syscall_tracepoint_update(p);
> > write_unlock_irq(&tasklist_lock);
> >
> > - if (pidfile)
> > + if (pidfile) {
> > + if (clone_flags & CLONE_PIDFD_AUTOKILL)
> > + p->signal->autokill_pidfd = pidfile;
> > fd_install(pidfd, pidfile);
>
> Just curious... Instead of adding signal->autokill_pidfd, can't we
> add another "not fcntl" PIDFD_AUTOKILL flag that lives in ->f_flags ?

This is a version I had as well and yes, that works too!