Skip to content

Commit

Permalink
job control: Small reorganization of wait_consider_task()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
htejun committed Mar 23, 2011
1 parent 408a37d commit 823b018
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kernel/exit.c
Expand Up @@ -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.
Expand All @@ -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.
*/
Expand Down

0 comments on commit 823b018

Please sign in to comment.