Skip to contentSkip to conversation

exit_notify: don't take tasklist for TIF_SIGPENDING re-targeting

PATCH In review Oleg Nesterov 2 participants 2 messages Aug 5, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 exit_notify: don't take tasklist for TIF_SIGPENDING re-targeting

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

kernel/exit.c renamed from kernel/exit.c~3_SIGPEND +1 -4
@@ -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)) &&