From a338f1c000980d42527e7ffd24efa3741d689495 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Fri, 8 Feb 2008 04:19:04 -0800 Subject: [PATCH] --- yaml --- r: 84654 b: refs/heads/master c: 96fabbf55ae79826f2e8a86f4066d7e8834315ae h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/exit.c | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index e4b2e2f8453d..6daf470068f7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1bad95c3bee183719e15eebffef66afc3fb3f8b0 +refs/heads/master: 96fabbf55ae79826f2e8a86f4066d7e8834315ae diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index 190a4cdcdb4d..9ee229ea97e4 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -1140,12 +1140,6 @@ static int eligible_child(pid_t pid, int options, struct task_struct *p) if (((p->exit_signal != SIGCHLD) ^ ((options & __WCLONE) != 0)) && !(options & __WALL)) return 0; - /* - * Do not consider thread group leaders that are - * in a non-empty thread group: - */ - if (delay_group_leader(p)) - return 2; err = security_task_wait(p); if (err) @@ -1497,10 +1491,9 @@ static long do_wait(pid_t pid, int options, struct siginfo __user *infop, tsk = current; do { struct task_struct *p; - int ret; list_for_each_entry(p, &tsk->children, sibling) { - ret = eligible_child(pid, options, p); + int ret = eligible_child(pid, options, p); if (!ret) continue; @@ -1524,19 +1517,17 @@ static long do_wait(pid_t pid, int options, struct siginfo __user *infop, retval = wait_task_stopped(p, (options & WNOWAIT), infop, stat_addr, ru); - } else if (p->exit_state == EXIT_ZOMBIE) { + } else if (p->exit_state == EXIT_ZOMBIE && + !delay_group_leader(p)) { /* - * Eligible but we cannot release it yet: + * We don't reap group leaders with subthreads. */ - if (ret == 2) - goto check_continued; if (!likely(options & WEXITED)) continue; retval = wait_task_zombie(p, (options & WNOWAIT), infop, stat_addr, ru); } else if (p->exit_state != EXIT_DEAD) { -check_continued: /* * It's running now, so it might later * exit, stop, or stop and then continue.