lkml.org 
[lkml]   [2019]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 4/5] pidfd: add CLONE_WAIT_PID
    On Thu, Jul 25, 2019 at 12:30:48PM +0200, Oleg Nesterov wrote:
    > On 07/24, Jann Horn wrote:
    > >
    > > --- a/kernel/fork.c
    > > +++ b/kernel/fork.c
    > > @@ -1902,6 +1902,10 @@ static __latent_entropy struct task_struct *copy_process(
    > > delayacct_tsk_init(p); /* Must remain after dup_task_struct() */
    > > p->flags &= ~(PF_SUPERPRIV | PF_WQ_WORKER | PF_IDLE);
    > > p->flags |= PF_FORKNOEXEC;
    > > + if (!(clone_flags & CLONE_THREAD))
    > > + p->flags &= ~PF_PF_WAIT_PID;
    > > + if (clone_flags & CLONE_WAIT_PID)
    > > + p->flags |= PF_PF_WAIT_PID;
    >
    > agreed, but then the "if (!thread_group_leader(tsk))" block in de_thread()
    > should also copy PF_PF_WAIT_PID.
    >
    > > An alternative would be to not use p->flags at all, but instead make
    > > this a property of the signal_struct - since the property is shared by
    > > all threads, that might make more sense?
    >
    > I tend to agree.

    Hm, ok. That's two people that prefer to make this a flag in
    signal_struct. Ok, let me adapt the patch.

    Thanks!
    Christian

    \
     
     \ /
      Last update: 2019-07-25 12:36    [W:5.315 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site