From: Zhou Guanghui zhouguanghui1@huawei.com
ascend inclusion category: feature bugzilla: NA CVE: NA
--------------------------------------------------
If memcg oom_kill_disable is false(enable oom killer), and sysctl enable_oom_killer is also false(disable oom killer), the memory allocated for this memcg will exceed the limit. This means that the memcg cannot limit the memory usage.
Therefore, ensure that sysctl enable_oom_killer is not false. Otherwise, wait for memory resources.
Signed-off-by: Zhou Guanghui zhouguanghui1@huawei.com Reviewed-by: Ding Tianhong dingtianhong@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com Signed-off-by: Cheng Jian cj.chengjian@huawei.com --- mm/memcontrol.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d926de1686ba..43e5102f90f0 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1799,7 +1799,11 @@ bool mem_cgroup_oom_synchronize(bool handle) if (locked) mem_cgroup_oom_notify(memcg);
- if (locked && !memcg->oom_kill_disable) { + if (locked && +#ifdef CONFIG_ASCEND_OOM + sysctl_enable_oom_killer != 0 && +#endif + !memcg->oom_kill_disable) { mem_cgroup_unmark_under_oom(memcg); finish_wait(&memcg_oom_waitq, &owait.wait); mem_cgroup_out_of_memory(memcg, current->memcg_oom_gfp_mask,