From 757eb1f447af3480a96aab3fc8d0589d3ff7c662 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 9 May 2012 10:09:58 -0500 Subject: [PATCH] --- yaml --- r: 319555 b: refs/heads/master c: f6e7def7f7d749759e4bf36dcc25ae289a20d868 h: refs/heads/master i: 319553: a8f624ee7409b87ca593f821af7933e6f5a587e9 319551: e58ddfef87d6131501ef9e6defc7c621cb6b43a2 v: v3 --- [refs] | 2 +- trunk/mm/slub.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 38dad16a643f..c507fd3bf0f5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c17dda40a6a4ed95f035db38b7ba4fab0d99da44 +refs/heads/master: f6e7def7f7d749759e4bf36dcc25ae289a20d868 diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c index 2389a016577e..6b60fc907a71 100644 --- a/trunk/mm/slub.c +++ b/trunk/mm/slub.c @@ -2208,6 +2208,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, unsigned long addr, struct kmem_cache_cpu *c) { void *freelist; + struct page *page; unsigned long flags; local_irq_save(flags); @@ -2220,13 +2221,14 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, c = this_cpu_ptr(s->cpu_slab); #endif - if (!c->page) + page = c->page; + if (!page) goto new_slab; redo: if (unlikely(!node_match(c, node))) { stat(s, ALLOC_NODE_MISMATCH); - deactivate_slab(s, c->page, c->freelist); + deactivate_slab(s, page, c->freelist); c->page = NULL; c->freelist = NULL; goto new_slab; @@ -2239,7 +2241,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, stat(s, ALLOC_SLOWPATH); - freelist = get_freelist(s, c->page); + freelist = get_freelist(s, page); if (!freelist) { c->page = NULL; @@ -2264,8 +2266,8 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, new_slab: if (c->partial) { - c->page = c->partial; - c->partial = c->page->next; + page = c->page = c->partial; + c->partial = page->next; stat(s, CPU_PARTIAL_ALLOC); c->freelist = NULL; goto redo; @@ -2281,14 +2283,15 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, return NULL; } + page = c->page; if (likely(!kmem_cache_debug(s))) goto load_freelist; /* Only entered in the debug case */ - if (!alloc_debug_processing(s, c->page, freelist, addr)) + if (!alloc_debug_processing(s, page, freelist, addr)) goto new_slab; /* Slab failed checks. Next slab needed */ - deactivate_slab(s, c->page, get_freepointer(s, freelist)); + deactivate_slab(s, page, get_freepointer(s, freelist)); c->page = NULL; c->freelist = NULL; local_irq_restore(flags);