Skip to content

Commit

Permalink
exit: exit_notify: re-use "dead" list to autoreap current
Browse files Browse the repository at this point in the history
After the previous change we can add just the exiting EXIT_DEAD task to
the "dead" list and remove another release_task(tsk).

Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Aaron Tomlin <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Sterling Alexander <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
oleg-nesterov authored and torvalds committed Dec 11, 2014
1 parent 482a376 commit 6c66e7d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
}

tsk->exit_state = autoreap ? EXIT_DEAD : EXIT_ZOMBIE;
if (tsk->exit_state == EXIT_DEAD)
list_add(&tsk->ptrace_entry, &dead);

/* mt-exec, de_thread() is waiting for group leader */
if (unlikely(tsk->signal->notify_count < 0))
Expand All @@ -642,10 +644,6 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
list_del_init(&p->ptrace_entry);
release_task(p);
}

/* If the process is dead, release it - nobody will wait for it */
if (autoreap)
release_task(tsk);
}

#ifdef CONFIG_DEBUG_STACK_USAGE
Expand Down

0 comments on commit 6c66e7d

Please sign in to comment.