[PATCH 1/3] will_become_orphaned_pgrp: we have threads

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>, Davide Libenzi <davidel@...>, Eric W. Biederman <ebiederm@...>, Ingo Molnar <mingo@...>, Linus Torvalds <torvalds@...>, Roland McGrath <roland@...>
Cc: <linux-kernel@...>
Date: Saturday, December 8, 2007 - 2:38 pm

p->exit_state != 0 doesn't mean this process is dead, it may have sub-threads.

However, the new "p->exit_state && thread_group_empty(p)" check is not correct
either, this is just the temporary hack. Perhaps we can just remove this check,
but I don't understand orphaned process groups magic. At all. However, I think
exit_notify() is obviously and completely wrong wrt this helper.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- PT/kernel/exit.c~4_orphaned_pgrp	2007-12-06 18:06:09.000000000 +0300
+++ PT/kernel/exit.c	2007-12-07 20:25:40.000000000 +0300
@@ -219,9 +219,9 @@ static int will_become_orphaned_pgrp(str
 	int ret = 1;
 
 	do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
-		if (p == ignored_task
-				|| p->exit_state
-				|| is_global_init(p->real_parent))
+		if ((p == ignored_task) ||
+		    (p->exit_state && thread_group_empty(p)) ||
+		    is_global_init(p->real_parent))
 			continue;
 		if (task_pgrp(p->real_parent) != pgrp &&
 		    task_session(p->real_parent) == task_session(p)) {

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/3] will_become_orphaned_pgrp: we have threads, Oleg Nesterov, (Sat Dec 8, 2:38 pm)
Re: [PATCH 1/3] will_become_orphaned_pgrp: we have threads, Eric W. Biederman, (Sat Dec 8, 7:50 pm)
Re: [PATCH 1/3] will_become_orphaned_pgrp: we have threads, Eric W. Biederman, (Sun Dec 9, 11:45 am)
Re: [PATCH 1/3] will_become_orphaned_pgrp: we have threads, Eric W. Biederman, (Sun Dec 9, 7:56 pm)
Re: [PATCH 1/3] will_become_orphaned_pgrp: we have threads, Eric W. Biederman, (Mon Dec 10, 9:36 pm)