• O
    move the related code from exit_notify() to exit_signals() · 5dee1707
    Oleg Nesterov 提交于
    The previous bugfix was not optimal, we shouldn't care about group stop
    when we are the only thread or the group stop is in progress.  In that case
    nothing special is needed, just set PF_EXITING and return.
    
    Also, take the related "TIF_SIGPENDING re-targeting" code from exit_notify().
    
    So, from the performance POV the only difference is that we don't trust
    !signal_pending() until we take ->siglock.  But this in fact fixes another
    ___pure___ theoretical minor race.  __group_complete_signal() finds the
    task without PF_EXITING and chooses it as the target for signal_wake_up().
    But nothing prevents this task from exiting in between without noticing the
    pending signal and thus unpredictably delaying the actual delivery.
    Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
    Cc: Davide Libenzi <davidel@xmailserver.org>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Roland McGrath <roland@redhat.com>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    5dee1707
signal.c 65.2 KB