aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-12-10 15:55:23 -0800
committerMoyster <oysterized@gmail.com>2019-05-02 18:28:39 +0200
commitdb6189c3062109cc1d38636e697b924c58b8bdc2 (patch)
tree16eae900967f2f99e85b8780526900b217a90a0a /kernel
parent31efea701a4d2b2177f58f080ef661a0387b09bf (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). Change-Id: I6c3139d27d8ebaf78aec9bf4093f776e37336ccb 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')
-rw-r--r--kernel/exit.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index d67d4fe90..1eb49f2f5 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -635,6 +635,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))
@@ -645,10 +647,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