diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2006-06-26 03:26:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:27 -0400 |
commit | 281de339ceb822ca6c04d4373ecb9a45c1890ce4 (patch) | |
tree | 8791013a7d92078a9c00a1a67c80c9b0760a9954 /fs/exec.c | |
parent | aceecc041217b35df753d1ed6e25bd17c0c558d8 (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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1371,17 +1371,24 @@ static void format_corename(char *corename, const char *pattern, long signr) | |||
1371 | static void zap_process(struct task_struct *start, int *ptraced) | 1371 | static 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 | ||
1387 | static void zap_threads (struct mm_struct *mm) | 1394 | static void zap_threads (struct mm_struct *mm) |