From b999a0485f495c0a4e77af88fcd92cfe264f9e64 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Wed, 24 Jun 2009 21:59:51 +0300 Subject: [PATCH] --- yaml --- r: 154293 b: refs/heads/master c: ba52270d18fb17ce2cf176b35419dab1e43fe4a3 h: refs/heads/master i: 154291: 27c2d8ca26c17503c54433c9d752abd71e0288df v: v3 --- [refs] | 2 +- trunk/mm/slub.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 9f23264ab395..087fe0bb1984 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4923abf9f1a4c1864af438a57c1f3686548230e9 +refs/heads/master: ba52270d18fb17ce2cf176b35419dab1e43fe4a3 diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c index ce62b770e2fc..819f056b39c6 100644 --- a/trunk/mm/slub.c +++ b/trunk/mm/slub.c @@ -1085,11 +1085,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) { struct page *page; struct kmem_cache_order_objects oo = s->oo; + gfp_t alloc_gfp; flags |= s->allocflags; - page = alloc_slab_page(flags | __GFP_NOWARN | __GFP_NORETRY, node, - oo); + /* + * Let the initial higher-order allocation fail under memory pressure + * so we fall-back to the minimum order allocation. + */ + alloc_gfp = (flags | __GFP_NOWARN | __GFP_NORETRY) & ~__GFP_NOFAIL; + + page = alloc_slab_page(alloc_gfp, node, oo); if (unlikely(!page)) { oo = s->min; /*