[PATCH 6/8] kill task_detached()

From: Oleg Nesterov
Date: Wed Jun 22 2011 - 17:11:54 EST


Upadate the last user of task_detached(), wait_task_zombie(), to
use thread_group_leader() and kill task_detached().

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
---

include/linux/sched.h | 5 -----
kernel/exit.c | 5 ++---
2 files changed, 2 insertions(+), 8 deletions(-)

--- ptrace/include/linux/sched.h~6_kill_task_detached 2011-06-22 22:47:12.000000000 +0200
+++ ptrace/include/linux/sched.h 2011-06-22 22:47:13.000000000 +0200
@@ -2319,11 +2319,6 @@ static inline int thread_group_empty(str
#define delay_group_leader(p) \
(thread_group_leader(p) && !thread_group_empty(p))

-static inline int task_detached(struct task_struct *p)
-{
- return p->exit_signal == -1;
-}
-
/*
* Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
* subscriptions and synchronises with wait4(). Also used in procfs. Also
--- ptrace/kernel/exit.c~6_kill_task_detached 2011-06-22 22:47:12.000000000 +0200
+++ ptrace/kernel/exit.c 2011-06-22 22:47:13.000000000 +0200
@@ -189,7 +189,6 @@ repeat:
zap_leader = 0;
leader = p->group_leader;
if (leader != p && thread_group_empty(leader) && leader->exit_state == EXIT_ZOMBIE) {
- BUG_ON(task_detached(leader));
/*
* If we were the last child thread and the leader has
* exited already, and the leader's parent ignores SIGCHLD,
@@ -1228,9 +1227,9 @@ static int wait_task_zombie(struct wait_
traced = ptrace_reparented(p);
/*
* It can be ptraced but not reparented, check
- * !task_detached() to filter out sub-threads.
+ * thread_group_leader() to filter out sub-threads.
*/
- if (likely(!traced) && likely(!task_detached(p))) {
+ if (likely(!traced) && thread_group_leader(p)) {
struct signal_struct *psig;
struct signal_struct *sig;
unsigned long maxrss;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/