From: Oleg Nesterov Date: Fri, 23 Mar 2012 22:02:45 +0000 (-0700) Subject: signal: oom_kill_task: use SEND_SIG_FORCED instead of force_sig() X-Git-Tag: MMI-PSA29.97-13-9~17191^2~16 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d2d393099de21eda91c5ec6a05d60e5dee4d5175;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Cc: Tejun Heo Cc: Anton Vorontsov Cc: "Eric W. Biederman" Cc: KOSAKI Motohiro Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 4198e000f41a..46bf2ed5594c 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -521,11 +521,11 @@ static void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, pr_err("Kill process %d (%s) sharing same memory\n", task_pid_nr(p), p->comm); task_unlock(p); - force_sig(SIGKILL, p); + do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, true); } set_tsk_thread_flag(victim, TIF_MEMDIE); - force_sig(SIGKILL, victim); + do_send_sig_info(SIGKILL, SEND_SIG_FORCED, victim, true); } #undef K