LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] exit_notify: don't take tasklist for TIF_SIGPENDING re-targeting
@ 2007-08-05 15:27 Oleg Nesterov
  2007-08-05 20:47 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2007-08-05 15:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Roland McGrath, linux-kernel

->siglock provides enough protection to iterate over the thread group.

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

--- t/kernel/exit.c~3_SIGPEND	2007-08-05 18:54:09.000000000 +0400
+++ t/kernel/exit.c	2007-08-05 19:16:38.000000000 +0400
@@ -756,13 +756,11 @@ static void exit_notify(struct task_stru
 		 * Now we'll wake all the threads in the group just to make
 		 * sure someone gets all the pending signals.
 		 */
-		read_lock(&tasklist_lock);
 		spin_lock_irq(&tsk->sighand->siglock);
 		for (t = next_thread(tsk); t != tsk; t = next_thread(t))
 			if (!signal_pending(t) && !(t->flags & PF_EXITING))
 				recalc_sigpending_and_wake(t);
 		spin_unlock_irq(&tsk->sighand->siglock);
-		read_unlock(&tasklist_lock);
 	}
 
 	write_lock_irq(&tasklist_lock);
@@ -790,9 +788,8 @@ static void exit_notify(struct task_stru
 	 * and we were the only connection outside, so our pgrp
 	 * is about to become orphaned.
 	 */
-	 
 	t = tsk->real_parent;
-	
+
 	pgrp = task_pgrp(tsk);
 	if ((task_pgrp(t) != pgrp) &&
 	    (task_session(t) == task_session(tsk)) &&


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] exit_notify: don't take tasklist for TIF_SIGPENDING re-targeting
  2007-08-05 15:27 [PATCH] exit_notify: don't take tasklist for TIF_SIGPENDING re-targeting Oleg Nesterov
@ 2007-08-05 20:47 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2007-08-05 20:47 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Andrew Morton, linux-kernel

Looks fine to me.

Thanks,
Roland

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-05 20:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-05 15:27 [PATCH] exit_notify: don't take tasklist for TIF_SIGPENDING re-targeting Oleg Nesterov
2007-08-05 20:47 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).