]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mm/oom_kill.c: suppress unnecessary "sharing same memory" message
authorTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Fri, 6 Nov 2015 02:47:54 +0000 (18:47 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Nov 2015 03:34:48 +0000 (19:34 -0800)
oom_kill_process() sends SIGKILL to other thread groups sharing victim's
mm.  But printing

  "Kill process %d (%s) sharing same memory\n"

lines makes no sense if they already have pending SIGKILL.  This patch
reduces the "Kill process" lines by printing that line with info level
only if SIGKILL is not pending.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Michal Hocko <mhocko@suse.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>
mm/oom_kill.c

index 5ba743aaba87c0b883a66c7339ac9e83bc94e520..c170d9f0a15866813dd8895069e2742c958074c5 100644 (file)
@@ -583,9 +583,11 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p,
                    !(p->flags & PF_KTHREAD)) {
                        if (p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN)
                                continue;
+                       if (fatal_signal_pending(p))
+                               continue;
 
                        task_lock(p);   /* Protect ->comm from prctl() */
-                       pr_err("Kill process %d (%s) sharing same memory\n",
+                       pr_info("Kill process %d (%s) sharing same memory\n",
                                task_pid_nr(p), p->comm);
                        task_unlock(p);
                        do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, true);