mm, page_alloc: warn for non-blockable __GFP_NOFAIL allocation failure
[firefly-linux-kernel-4.4.55.git] / mm / page_alloc.c
index 84da0e3bc8869e625b2ad57af17ac17319ce9fcd..533e2147d14f8db9c6a6fe2090162f1e5dbff0e6 100644 (file)
@@ -2525,8 +2525,15 @@ rebalance:
        }
 
        /* Atomic allocations - we can't balance anything */
-       if (!wait)
+       if (!wait) {
+               /*
+                * All existing users of the deprecated __GFP_NOFAIL are
+                * blockable, so warn of any new users that actually allow this
+                * type of allocation to fail.
+                */
+               WARN_ON_ONCE(gfp_mask & __GFP_NOFAIL);
                goto nopage;
+       }
 
        /* Avoid recursion of direct reclaim */
        if (current->flags & PF_MEMALLOC)