Skip to content

Commit

Permalink
[PATCH] coredump: speedup SIGKILL sending
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Acked-by: Roland McGrath <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Jun 26, 2006
1 parent aceecc0 commit 281de33
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 281de33

Please sign in to comment.