mm, show_mem: suppress page counts in non-blockable contexts
[pandora-kernel.git] / mm / page_alloc.c
index b5afea2..d8762b2 100644 (file)
@@ -1759,6 +1759,13 @@ void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...)
        if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs))
                return;
 
+       /*
+        * Walking all memory to count page types is very expensive and should
+        * be inhibited in non-blockable contexts.
+        */
+       if (!(gfp_mask & __GFP_WAIT))
+               filter |= SHOW_MEM_FILTER_PAGE_COUNT;
+
        /*
         * This documents exceptions given to allocations in certain
         * contexts that are allowed to allocate outside current's set