diff options
author | Tejun Heo <tj@kernel.org> | 2011-03-23 05:37:01 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-03-23 05:37:01 -0400 |
commit | 823b018e5b1196d810790559357447948f644548 (patch) | |
tree | a7bb20bc487a08943c25e789c51c790aef14d169 /kernel/exit.c | |
parent | 408a37de6c95832a4880a88a742f89f0cc554d06 (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.c | 7 |
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, | |||
1537 | return 0; | 1537 | return 0; |
1538 | } | 1538 | } |
1539 | 1539 | ||
1540 | /* dead body doesn't have much to contribute */ | ||
1541 | if (p->exit_state == EXIT_DEAD) | ||
1542 | return 0; | ||
1543 | |||
1540 | if (likely(!ptrace) && unlikely(task_ptrace(p))) { | 1544 | if (likely(!ptrace) && unlikely(task_ptrace(p))) { |
1541 | /* | 1545 | /* |
1542 | * This child is hidden by ptrace. | 1546 | * This child is hidden by ptrace. |
@@ -1546,9 +1550,6 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace, | |||
1546 | return 0; | 1550 | return 0; |
1547 | } | 1551 | } |
1548 | 1552 | ||
1549 | if (p->exit_state == EXIT_DEAD) | ||
1550 | return 0; | ||
1551 | |||
1552 | /* | 1553 | /* |
1553 | * We don't reap group leaders with subthreads. | 1554 | * We don't reap group leaders with subthreads. |
1554 | */ | 1555 | */ |