Don't warn about order-1 allocations with __GFP_NOFAIL
authorLinus Torvalds <[email protected]>
Wed, 24 Jun 2009 19:16:49 +0000 (12:16 -0700)
committerLinus Torvalds <[email protected]>
Wed, 24 Jun 2009 19:16:49 +0000 (12:16 -0700)
Traditionally, we never failed small orders (even regardless of any
__GFP_NOFAIL flags), and slab will allocate order-1 allocations even for
small allocations that could fit in a single page (in order to avoid
excessive fragmentation).

Maybe we should remove this warning entirely, but before making that
judgement, at least limit it to bigger allocations.

Acked-by: Pekka Enberg <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/page_alloc.c

index aecc9cdfdfce9111ef55de91a38afb164d6fad87..5d714f8fb30333f6de336e555f944658bfa1dc16 100644 (file)
@@ -1153,10 +1153,10 @@ again:
                         * properly detect and handle allocation failures.
                         *
                         * We most definitely don't want callers attempting to
-                        * allocate greater than single-page units with
+                        * allocate greater than order-1 page units with
                         * __GFP_NOFAIL.
                         */
-                       WARN_ON_ONCE(order > 0);
+                       WARN_ON_ONCE(order > 1);
                }
                spin_lock_irqsave(&zone->lock, flags);
                page = __rmqueue(zone, order, migratetype);