mm: memcg: do not trap chargers with full callstack on OOM
[firefly-linux-kernel-4.4.55.git] / mm / oom_kill.c
index f104c7e9f61efa4cfd61d4c6af544b1eabf2806b..1a582e3aee3eb700004dd93b95cd66dee8928d0e 100644 (file)
@@ -702,9 +702,12 @@ out:
  */
 void pagefault_out_of_memory(void)
 {
-       struct zonelist *zonelist = node_zonelist(first_online_node,
-                                                 GFP_KERNEL);
+       struct zonelist *zonelist;
 
+       if (mem_cgroup_oom_synchronize())
+               return;
+
+       zonelist = node_zonelist(first_online_node, GFP_KERNEL);
        if (try_set_zonelist_oom(zonelist, GFP_KERNEL)) {
                out_of_memory(NULL, 0, 0, NULL, false);
                clear_zonelist_oom(zonelist, GFP_KERNEL);