Commit 0c1b2d78 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

mm/oom_kill: remove the wrong fatal_signal_pending() check in oom_kill_process()

The fatal_signal_pending() was added to suppress unnecessary "sharing same
memory" message, but it can't 100% help anyway because it can be
false-negative; SIGKILL can be already dequeued.

And worse, it can be false-positive due to exec or coredump.  exec is
mostly fine, but coredump is not.  It is possible that the group leader
has the pending SIGKILL because its sub-thread originated the coredump, in
this case we must not skip this process.

We could probably add the additional ->group_exit_task check but this
patch just removes the wrong check along with pr_info().
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Acked-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Cc: Kyle Walker <kwalker@redhat.com>
Cc: Stanislav Kozina <skozina@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 09357814
...@@ -579,11 +579,7 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p, ...@@ -579,11 +579,7 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p,
!(p->flags & PF_KTHREAD)) { !(p->flags & PF_KTHREAD)) {
if (p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) if (p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN)
continue; continue;
if (fatal_signal_pending(p))
continue;
pr_info("Kill process %d (%s) sharing same memory\n",
task_pid_nr(p), p->comm);
do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, true); do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, true);
} }
rcu_read_unlock(); rcu_read_unlock();
......
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