[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110622210939.GF20549@redhat.com>
Date: Wed, 22 Jun 2011 23:09:39 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Tejun Heo <tj@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
hch@...radead.org
Subject: [PATCH 5/8] reparent_leader: check EXIT_DEAD instead of
task_detached()
Change reparent_leader() to check ->exit_state instead of ->exit_signal,
this matches the similar EXIT_DEAD check in wait_consider_task() and
allows us to cleanup the do_notify_parent/task_detached logic.
task_detached() was really needed during reparenting before 9cd80bbb
"do_wait() optimization: do not place sub-threads on ->children list"
to filter out the sub-threads. After this change task_detached(p) can
only be true if p is the dead group_leader and its parent ignores
SIGCHLD, in this case the caller of do_notify_parent() is going to
reap this task and it should set EXIT_DEAD.
Signed-off-by: Oleg Nesterov <oleg@...hat.com>
---
kernel/exit.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- ptrace/kernel/exit.c~5_reparent_leader_ck_exit_dead 2011-06-22 22:47:12.000000000 +0200
+++ ptrace/kernel/exit.c 2011-06-22 22:47:12.000000000 +0200
@@ -741,7 +741,7 @@ static void reparent_leader(struct task_
{
list_move_tail(&p->sibling, &p->real_parent->children);
- if (task_detached(p))
+ if (p->exit_state == EXIT_DEAD)
return;
/*
* If this is a threaded reparent there is no need to
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists