lkml.org 
[lkml]   [2021]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH V3] exit: trigger panic when global init has exited
    On 03/19, qianli zhao wrote:
    >
    > I will think about the risks of movement of the decrement of
    > signal->live before exit_signal().
    > If is difficult to judge movement of the decrement of signal->live is
    > safe,how about only test 'signal->live==1' not use group_dead?
    >
    > Such as:
    > diff --git a/kernel/exit.c b/kernel/exit.c
    > index 04029e3..87f3595 100644
    > --- a/kernel/exit.c
    > +++ b/kernel/exit.c
    > @@ -767,6 +767,17 @@ void __noreturn do_exit(long code)
    > validate_creds_for_do_exit(tsk);
    >
    > /*
    > + * If global init has exited,
    > + * panic immediately to get a useable coredump.
    > + */
    > + if (unlikely(is_global_init(tsk) &&
    > + ((atomic_read(&tsk->signal->live) == 1) || /*current is
    > last init thread*/

    Just suppose signal->live == 2 and both init's sub-threads exit at the
    same time. They both can see signal->live == 2, panic() won't be called.

    Oleg.

    \
     
     \ /
      Last update: 2021-03-19 17:36    [W:4.428 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site