memcg: fix mem_cgroup_out_of_memory() return value.
Subsystems (2)
[email protected]
maintainerPATCH 6/10 memcg: fix mem_cgroup_out_of_memory() return value.
From: Tetsuo Handa <[email protected]>
Subject: memcg: fix mem_cgroup_out_of_memory() return value.
mem_cgroup_out_of_memory() is returning "true" if it finds a TIF_MEMDIE task after an eligible task was found, "false" if it found a TIF_MEMDIE task before an eligible task is found.
This difference confuses memory_max_write() which checks the return value of mem_cgroup_out_of_memory(). Since memory_max_write() wants to continue looping, mem_cgroup_out_of_memory() should return "true" in this case.
This patch sets a dummy pointer in order to return "true".
Link http://lkml.kernel.org/r/1463753327-5170-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp open here
Signed-off-by Tetsuo Handa <[email protected]>
Acked-by Michal Hocko <[email protected]>
Acked-by Vladimir Davydov <[email protected]>
Cc Johannes Weiner <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/memcontrol.c | 2 ++ 1 file changed, 2 insertions(+)
mm/memcontrol.c renamed from mm/memcontrol.c~memcg-fix-mem_cgroup_out_of_memory-return-value +2 -0
@@ -1302,6 +1302,8 @@ static bool mem_cgroup_out_of_memory(strmem_cgroup_iter_break (memcg, iter);if (chosen)put_task_struct (chosen); +/* Set a dummy value to return "true". */ + chosen = (void *)1 ; goto unlock;case OOM_SCAN_OK :break ;
_