Commit 823b018e authored by Tejun Heo's avatar Tejun Heo

job control: Small reorganization of wait_consider_task()

Move EXIT_DEAD test in wait_consider_task() above ptrace check.  As
ptraced tasks can't be EXIT_DEAD, this change doesn't cause any
behavior change.  This is to prepare for further changes.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
parent 408a37de
...@@ -1537,6 +1537,10 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace, ...@@ -1537,6 +1537,10 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
return 0; return 0;
} }
/* dead body doesn't have much to contribute */
if (p->exit_state == EXIT_DEAD)
return 0;
if (likely(!ptrace) && unlikely(task_ptrace(p))) { if (likely(!ptrace) && unlikely(task_ptrace(p))) {
/* /*
* This child is hidden by ptrace. * This child is hidden by ptrace.
...@@ -1546,9 +1550,6 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace, ...@@ -1546,9 +1550,6 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
return 0; return 0;
} }
if (p->exit_state == EXIT_DEAD)
return 0;
/* /*
* We don't reap group leaders with subthreads. * We don't reap group leaders with subthreads.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment