diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-12-10 18:55:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:18 -0500 |
commit | 6c66e7dba3d4419c8b973505679635efcd6b311c (patch) | |
tree | 95ae4db5d7768a6b96e3e0e26337348e2aa03b56 /kernel/exit.c | |
parent | 482a3767e5087f6e6ad2486a6655aaa5f3d59301 (diff) |
exit: exit_notify: re-use "dead" list to autoreap current
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 <oleg@redhat.com>
Cc: Aaron Tomlin <atomlin@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Sterling Alexander <stalexan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 8061891ddd9b..8714e5ded8b4 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -632,6 +632,8 @@ static void exit_notify(struct task_struct *tsk, int group_dead) | |||
632 | } | 632 | } |
633 | 633 | ||
634 | tsk->exit_state = autoreap ? EXIT_DEAD : EXIT_ZOMBIE; | 634 | tsk->exit_state = autoreap ? EXIT_DEAD : EXIT_ZOMBIE; |
635 | if (tsk->exit_state == EXIT_DEAD) | ||
636 | list_add(&tsk->ptrace_entry, &dead); | ||
635 | 637 | ||
636 | /* mt-exec, de_thread() is waiting for group leader */ | 638 | /* mt-exec, de_thread() is waiting for group leader */ |
637 | if (unlikely(tsk->signal->notify_count < 0)) | 639 | if (unlikely(tsk->signal->notify_count < 0)) |
@@ -642,10 +644,6 @@ static void exit_notify(struct task_struct *tsk, int group_dead) | |||
642 | list_del_init(&p->ptrace_entry); | 644 | list_del_init(&p->ptrace_entry); |
643 | release_task(p); | 645 | release_task(p); |
644 | } | 646 | } |
645 | |||
646 | /* If the process is dead, release it - nobody will wait for it */ | ||
647 | if (autoreap) | ||
648 | release_task(tsk); | ||
649 | } | 647 | } |
650 | 648 | ||
651 | #ifdef CONFIG_DEBUG_STACK_USAGE | 649 | #ifdef CONFIG_DEBUG_STACK_USAGE |