From 99e7aa9bd57662758af021d123bb1d983b21b99d Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 1 Jun 2011 12:25:44 -0500 Subject: [PATCH] --- yaml --- r: 261643 b: refs/heads/master c: 7e0528dadc9f8b04e4de0dba48a075100c2afe75 h: refs/heads/master i: 261641: 3516d93ce560c37da139e9565639bd351db524f1 261639: ff1e8d94c587eb093cf9dd08b0d7ac553a874b28 v: v3 --- [refs] | 2 +- trunk/mm/slub.c | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 4df4d7055ce0..3a410bfb3857 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e4a46182e1bcc2ddacff5a35f6b52398b51f1b11 +refs/heads/master: 7e0528dadc9f8b04e4de0dba48a075100c2afe75 diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c index 35f351f26193..add2ae74046c 100644 --- a/trunk/mm/slub.c +++ b/trunk/mm/slub.c @@ -1187,6 +1187,11 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) struct kmem_cache_order_objects oo = s->oo; gfp_t alloc_gfp; + flags &= gfp_allowed_mask; + + if (flags & __GFP_WAIT) + local_irq_enable(); + flags |= s->allocflags; /* @@ -1203,12 +1208,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) * Try a lower order alloc if possible */ page = alloc_slab_page(flags, node, oo); - if (!page) - return NULL; - stat(s, ORDER_FALLBACK); + if (page) + stat(s, ORDER_FALLBACK); } + if (flags & __GFP_WAIT) + local_irq_disable(); + + if (!page) + return NULL; + if (kmemcheck_enabled && !(s->flags & (SLAB_NOTRACK | DEBUG_DEFAULT_FLAGS))) { int pages = 1 << oo_order(oo); @@ -1849,15 +1859,8 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, goto load_freelist; } - gfpflags &= gfp_allowed_mask; - if (gfpflags & __GFP_WAIT) - local_irq_enable(); - page = new_slab(s, gfpflags, node); - if (gfpflags & __GFP_WAIT) - local_irq_disable(); - if (page) { c = __this_cpu_ptr(s->cpu_slab); stat(s, ALLOC_SLAB);