diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2006-06-26 09:26:06 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 18:58:27 +0200 |
commit | 281de339ceb822ca6c04d4373ecb9a45c1890ce4 (patch) | |
tree | 8791013a7d92078a9c00a1a67c80c9b0760a9954 /fs/exec.c | |
parent | [PATCH] coredump: optimize ->mm users traversal (diff) | |
download | linux-281de339ceb822ca6c04d4373ecb9a45c1890ce4.tar.xz linux-281de339ceb822ca6c04d4373ecb9a45c1890ce4.zip |
[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
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) 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) |