aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-06-26 03:26:06 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 12:58:27 -0400
commit281de339ceb822ca6c04d4373ecb9a45c1890ce4 (patch)
tree8791013a7d92078a9c00a1a67c80c9b0760a9954 /fs/exec.c
parentaceecc041217b35df753d1ed6e25bd17c0c558d8 (diff)
[PATCH] coredump: speedup SIGKILL sending
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> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 80fe7bcfa094..a5c51646d1ad 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1371,17 +1371,24 @@ static void format_corename(char *corename, const char *pattern, long signr)
1371static void zap_process(struct task_struct *start, int *ptraced) 1371static void zap_process(struct task_struct *start, int *ptraced)
1372{ 1372{
1373 struct task_struct *t; 1373 struct task_struct *t;
1374 unsigned long flags;
1375
1376 spin_lock_irqsave(&start->sighand->siglock, flags);
1374 1377
1375 t = start; 1378 t = start;
1376 do { 1379 do {
1377 if (t != current && t->mm) { 1380 if (t != current && t->mm) {
1378 t->mm->core_waiters++; 1381 t->mm->core_waiters++;
1379 force_sig_specific(SIGKILL, t); 1382 sigaddset(&t->pending.signal, SIGKILL);
1383 signal_wake_up(t, 1);
1384
1380 if (unlikely(t->ptrace) && 1385 if (unlikely(t->ptrace) &&
1381 unlikely(t->parent->mm == t->mm)) 1386 unlikely(t->parent->mm == t->mm))
1382 *ptraced = 1; 1387 *ptraced = 1;
1383 } 1388 }
1384 } while ((t = next_thread(t)) != start); 1389 } while ((t = next_thread(t)) != start);
1390
1391 spin_unlock_irqrestore(&start->sighand->siglock, flags);
1385} 1392}
1386 1393
1387static void zap_threads (struct mm_struct *mm) 1394static void zap_threads (struct mm_struct *mm)