Skip to content

Commit

Permalink
slub: Not necessary to check for empty slab on load_freelist
Browse files Browse the repository at this point in the history
load_freelist is now only branched to only if there are objects available.
So no need to check the object variable for NULL.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed Jul 2, 2011
1 parent 03e404a commit 4eade54
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1997,9 +1997,6 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
NULL, new.counters,
"__slab_alloc"));

load_freelist:
VM_BUG_ON(!page->frozen);

if (unlikely(!object)) {
c->page = NULL;
stat(s, DEACTIVATE_BYPASS);
Expand All @@ -2008,6 +2005,8 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,

stat(s, ALLOC_REFILL);

load_freelist:
VM_BUG_ON(!page->frozen);
c->freelist = get_freepointer(s, object);
c->tid = next_tid(c->tid);
local_irq_restore(flags);
Expand Down

0 comments on commit 4eade54

Please sign in to comment.