Since mem_cgroup_out_of_memory() is called by mem_cgroup_oom_synchronize(true) via pagefault_out_of_memory() via page fault, and possible allocations between setting PF_EXITING and calling exit_mm() are tty_audit_exit() and taskstats_exit() which will not trigger page fault, task_will_free_mem(current) in mem_cgroup_out_of_memory() is never true. Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ae8b81c..701bef1 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1254,11 +1254,11 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, mutex_lock(&oom_lock); /* - * If current has a pending SIGKILL or is exiting, then automatically - * select it. The goal is to allow it to allocate so that it may - * quickly exit and free its memory. + * If current has a pending SIGKILL, then automatically select it. + * The goal is to allow it to allocate so that it may quickly exit + * and free its memory. */ - if (fatal_signal_pending(current) || task_will_free_mem(current)) { + if (fatal_signal_pending(current)) { mark_oom_victim(current); goto unlock; } -- 1.8.3.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>