提交 a4229072 编写于 作者: Z zhongjiang-ali 提交者: Xu Yu

alinux: Limit the print message frequency when memcg oom triggers

fix #25854413

By above message, we see that a lot of memcg oom is triggered by
test cases. And has no eligiable process to be killed in that case.
Hence, It will print too much oom message by dump_header, resulting
in the interrupt is not responded normally.

The patch restrict the print times by ratelimit when memcg oom
triggers. And as for system level oom, we do not limit tht case
because it will panic later.
Reviewed-by: NXunlei Pang <xlpang@linux.alibaba.com>
Signed-off-by: Nzhongjiang-ali <zhongjiang-ali@linux.alibaba.com>
上级 8962f125
......@@ -1145,7 +1145,11 @@ bool out_of_memory(struct oom_control *oc)
select_bad_process(oc);
/* Found nothing?!?! */
if (!oc->chosen) {
dump_global_header(oc, NULL);
if (is_memcg_oom(oc) && __ratelimit(&oom_memcg_rs))
dump_memcg_header(oc, NULL);
else if (!is_memcg_oom(oc))
dump_global_header(oc, NULL);
pr_warn("Out of memory and no killable processes...\n");
/*
* If we got here due to an actual allocation at the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册