[PATCH] mm, oom: Don't emit noises for failed SysRq-f.

From: Tetsuo Handa
Date: Sat Sep 08 2018 - 09:26:28 EST


Due to commit d75da004c708c9fc ("oom: improve oom disable handling") and
commit 3100dab2aa09dc6e ("mm: memcontrol: print proper OOM header when
no eligible victim left"), all

kworker/0:1 invoked oom-killer: gfp_mask=0x6000c0(GFP_KERNEL), nodemask=(null), order=-1, oom_score_adj=0
(...snipped...)
Out of memory and no killable processes...
OOM request ignored. No task eligible

lines are printed.
Let's not emit "invoked oom-killer" lines when SysRq-f failed.

Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
---
mm/oom_kill.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index f10aa53..92122ef 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -1106,8 +1106,10 @@ bool out_of_memory(struct oom_control *oc)
select_bad_process(oc);
/* Found nothing?!?! */
if (!oc->chosen) {
- dump_header(oc, NULL);
- pr_warn("Out of memory and no killable processes...\n");
+ if (!is_sysrq_oom(oc)) {
+ dump_header(oc, NULL);
+ pr_warn("Out of memory and no killable processes...\n");
+ }
/*
* If we got here due to an actual allocation at the
* system level, we cannot survive this and will enter
--
1.8.3.1