提交 281de339 编写于 作者: O Oleg Nesterov 提交者: 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: NOleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: NRoland McGrath <roland@redhat.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 aceecc04
...@@ -1371,17 +1371,24 @@ static void format_corename(char *corename, const char *pattern, long signr) ...@@ -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) static void zap_process(struct task_struct *start, int *ptraced)
{ {
struct task_struct *t; struct task_struct *t;
unsigned long flags;
spin_lock_irqsave(&start->sighand->siglock, flags);
t = start; t = start;
do { do {
if (t != current && t->mm) { if (t != current && t->mm) {
t->mm->core_waiters++; t->mm->core_waiters++;
force_sig_specific(SIGKILL, t); sigaddset(&t->pending.signal, SIGKILL);
signal_wake_up(t, 1);
if (unlikely(t->ptrace) && if (unlikely(t->ptrace) &&
unlikely(t->parent->mm == t->mm)) unlikely(t->parent->mm == t->mm))
*ptraced = 1; *ptraced = 1;
} }
} while ((t = next_thread(t)) != start); } while ((t = next_thread(t)) != start);
spin_unlock_irqrestore(&start->sighand->siglock, flags);
} }
static void zap_threads (struct mm_struct *mm) static void zap_threads (struct mm_struct *mm)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册