memcg, oom: don't require __GFP_FS when invoking memcg OOM killer
[linux-2.6-microblaze.git] / mm / oom_kill.c
index 95872bd..a6b7662 100644 (file)
@@ -1069,9 +1069,10 @@ bool out_of_memory(struct oom_control *oc)
         * The OOM killer does not compensate for IO-less reclaim.
         * pagefault_out_of_memory lost its gfp context so we have to
         * make sure exclude 0 mask - all other users should have at least
-        * ___GFP_DIRECT_RECLAIM to get here.
+        * ___GFP_DIRECT_RECLAIM to get here. But mem_cgroup_oom() has to
+        * invoke the OOM killer even if it is a GFP_NOFS allocation.
         */
-       if (oc->gfp_mask && !(oc->gfp_mask & __GFP_FS))
+       if (oc->gfp_mask && !(oc->gfp_mask & __GFP_FS) && !is_memcg_oom(oc))
                return true;
 
        /*