Skip to content

Commit d2d3930

Browse files
oleg-nesterovtorvalds
authored andcommitted
signal: oom_kill_task: use SEND_SIG_FORCED instead of force_sig()
Change oom_kill_task() to use do_send_sig_info(SEND_SIG_FORCED) instead of force_sig(SIGKILL). With the recent changes we do not need force_ to kill the CLONE_NEWPID tasks. And this is more correct. force_sig() can race with the exiting thread even if oom_kill_task() checks p->mm != NULL, while do_send_sig_info(group => true) kille the whole process. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Tejun Heo <tj@kernel.org> Cc: Anton Vorontsov <anton.vorontsov@linaro.org> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent def8cf7 commit d2d3930

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/oom_kill.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,11 +521,11 @@ static void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
521521
pr_err("Kill process %d (%s) sharing same memory\n",
522522
task_pid_nr(p), p->comm);
523523
task_unlock(p);
524-
force_sig(SIGKILL, p);
524+
do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, true);
525525
}
526526

527527
set_tsk_thread_flag(victim, TIF_MEMDIE);
528-
force_sig(SIGKILL, victim);
528+
do_send_sig_info(SIGKILL, SEND_SIG_FORCED, victim, true);
529529
}
530530
#undef K
531531

0 commit comments

Comments
 (0)