Skip to content

Commit

Permalink
slub: Get rid of the another_slab label
Browse files Browse the repository at this point in the history
We can avoid deactivate slab in special cases if we do the
deactivation of slabs in each code flow that leads to new_slab.

Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed Jul 2, 2011
1 parent 80f08c1 commit fc59c05
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1965,8 +1965,10 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
if (!page)
goto new_slab;

if (unlikely(!node_match(c, node)))
goto another_slab;
if (unlikely(!node_match(c, node))) {
deactivate_slab(s, c);
goto new_slab;
}

stat(s, ALLOC_SLOWPATH);

Expand All @@ -1986,7 +1988,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
VM_BUG_ON(!page->frozen);

if (unlikely(!object))
goto another_slab;
goto new_slab;

stat(s, ALLOC_REFILL);

Expand All @@ -1995,9 +1997,6 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
local_irq_restore(flags);
return object;

another_slab:
deactivate_slab(s, c);

new_slab:
page = get_partial(s, gfpflags, node);
if (page) {
Expand Down

0 comments on commit fc59c05

Please sign in to comment.