Commit 281de339 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

[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: default avatarOleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent aceecc04
No related merge requests found
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment