exit: exit_notify() can trust signal->notify_count < 0
PATCH 1/4 exit: exit_notify() can trust signal->notify_count < 0
Now that Veaceslav changed copy_signal() to use zalloc(), exit_notify() can just check notify_count < 0 to ensure the execing sub-threads needs the notification from us. No need to do other checks, notify_count != 0 must always mean ->group_exit_task != NULL is waiting for us.
Signed-off-by Oleg Nesterov <[email protected]>
---
kernel/exit.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
kernel/exit.c renamed from kernel/exit.c~1_EXIT_NOTIFY +2 -5
@@ -857,12 +857,9 @@ static void exit_notify(struct task_stru tsk->exit_state = signal ==DEATH_REAP ?EXIT_DEAD :EXIT_ZOMBIE ; -/* mt-exec, de_thread() is waiting for us */ -if (thread_group_leader (tsk) && - tsk->signal->group_exit_task && - tsk->signal->notify_count <0 ) +/* mt-exec, de_thread() is waiting for group leader */ +if (unlikely (tsk->signal->notify_count <0 ))wake_up_process (tsk->signal->group_exit_task); -write_unlock_irq (&tasklist_lock);tracehook_report_death (tsk, signal, cookie, group_dead);