aboutsummaryrefslogtreecommitdiff
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorTejun Heo2011-03-23 10:37:01 +0100
committerTejun Heo2011-03-23 10:37:01 +0100
commit823b018e5b1196d810790559357447948f644548 (patch)
treea7bb20bc487a08943c25e789c51c790aef14d169 /kernel/exit.c
parent408a37de6c95832a4880a88a742f89f0cc554d06 (diff)
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: Tejun Heo <tj@kernel.org> Acked-by: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index f9a45ebcc7b1..b4a935c72159 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1537,6 +1537,10 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
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))) {
/*
* This child is hidden by ptrace.
@@ -1546,9 +1550,6 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
return 0;
}
- if (p->exit_state == EXIT_DEAD)
- return 0;
-
/*
* We don't reap group leaders with subthreads.
*/