public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/4] coredump: speedup SIGKILL sending
@ 2006-04-06 22:06 Oleg Nesterov
  2006-04-06 19:45 ` Lee Revell
  2006-04-10  4:11 ` Roland McGrath
  0 siblings, 2 replies; 7+ messages in thread
From: Oleg Nesterov @ 2006-04-06 22:06 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Eric W. Biederman, Ingo Molnar, Paul E. McKenney, Roland McGrath,
	linux-kernel

With this patch a thread group is killed atomically under ->siglock.
This is faster because we can use sigaddset() instead of force_sig_info()
and this is used in further patches.

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

--- rc1/fs/exec.c~2_KILL	2006-04-06 15:10:28.000000000 +0400
+++ rc1/fs/exec.c	2006-04-06 15:19:33.000000000 +0400
@@ -1387,17 +1387,24 @@ static void format_corename(char *corena
 static void zap_process(struct task_struct *start, int *ptraced)
 {
 	struct task_struct *t;
+	unsigned long flags;
+
+	spin_lock_irqsave(&start->sighand->siglock, flags);
 
 	t = start;
 	do {
 		if (t != current && t->mm) {
 			t->mm->core_waiters++;
-			force_sig_specific(SIGKILL, t);
+			sigaddset(&t->pending.signal, SIGKILL);
+			signal_wake_up(t, 1);
+
 			if (unlikely(t->ptrace) &&
 			    unlikely(t->parent->mm == t->mm))
 				*ptraced = 1;
 		}
 	} while ((t = next_thread(t)) != start);
+
+	spin_unlock_irqrestore(&start->sighand->siglock, flags);
 }
 
 static void zap_threads (struct mm_struct *mm)


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

end of thread, other threads:[~2006-04-10  4:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-06 22:06 [PATCH 2/4] coredump: speedup SIGKILL sending Oleg Nesterov
2006-04-06 19:45 ` Lee Revell
2006-04-06 23:55   ` Oleg Nesterov
2006-04-06 20:07     ` Lee Revell
2006-04-07 23:28       ` Oleg Nesterov
2006-04-07 19:42         ` Lee Revell
2006-04-10  4:11 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox