From: Christoph Lameter Subject: slub: Fix fallback behavior The initial higher order allocation should fail without any noise making so add __GFP_NOWARN. And also allow fallback to a nonzero order if the slab object size is larger than PAGE_SIZE. Signed-off-by: Christoph Lameter --- mm/slub.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2008-02-15 22:57:41.000000000 -0800 +++ linux-2.6/mm/slub.c 2008-02-15 22:58:45.000000000 -0800 @@ -1063,22 +1063,19 @@ static struct page *allocate_slab(struct flags |= s->allocflags; - page = alloc_slab_page(flags, node, s->order); + page = alloc_slab_page(flags | __GFP_NOWARN, node, s->order); if (unlikely(!page)) { /* * Allocation may have failed due to fragmentation. - * Try an order 0 alloc alloc + * Try a lower order alloc if possible */ - if (s->size <= PAGE_SIZE) { - pages = 1; - page = alloc_slab_page(flags, node, 0); - } - - if (!page) - return NULL; - else + page = alloc_slab_page(flags, node, get_order(s->size)); + if (page) { + pages = 1 << compound_order(page); stat(get_cpu_slab(s, raw_smp_processor_id()), ORDER_FALLBACK); + } else + return NULL; } mod_zone_page_state(page_zone(page), (s->flags & SLAB_RECLAIM_ACCOUNT) ?