From ec661706b1c974b8228b677a74e3ab219e0140f3 Mon Sep 17 00:00:00 2001 From: Xu Yu Date: Fri, 13 Mar 2020 11:35:07 +0800 Subject: [PATCH] alinux: mm, memcg: abort priority oom if with oom victim Explicitly abort mem_cgroup_select_bad_process in priority oom if there is already a task as oom victim without MMF_OOM_SKIP flag set. Signed-off-by: Xu Yu Reviewed-by: Yang Shi --- mm/memcontrol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 678caf8a68d3..2f06a0edd6be 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1266,6 +1266,8 @@ void mem_cgroup_select_bad_process(struct oom_control *oc) mem_cgroup_scan_tasks(victim, oom_evaluate_task, oc); if (oc->use_priority_oom) { css_put(&victim->css); + if (oc->chosen == (void *)-1UL) + goto out; if (!oc->chosen && victim != memcg) { do_mem_cgroup_account_oom_skip(victim, oc); goto retry; -- GitLab