mm: oom: wait for exit of killed current task

Current task in OOM path could be holding enough memory
that is not reapable by oom reaper. Fail the allocation
and let the task exit before triggering OOM.

Change-Id: Ie00911548c5b16a430767f0b60761d839fc43f78
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
This commit is contained in:
Vinayak Menon 2020-10-23 16:42:28 +05:30
commit 763b4d11af

View file

@ -1160,6 +1160,10 @@ bool out_of_memory(struct oom_control *oc)
CONFIG_OOM_TASK_PRIORITY_ADJ_LIMIT);
oc->min_kill_adj = prev_min_kill_adj;
oc->chosen_points = 0;
if (tsk_is_oom_victim(current)) {
pr_warn_ratelimited("current killed, retry\n");
return true;
}
}
}