Skip to content

Commit

Permalink
slub: look up object from the freelist once
Browse files Browse the repository at this point in the history
We only need to look up object from c->page->freelist once in
__slab_alloc().

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
  • Loading branch information
Pekka J Enberg authored and Christoph Lameter committed Mar 3, 2008
1 parent 6446faa commit 7693143
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,6 @@ static void *__slab_alloc(struct kmem_cache *s,
if (unlikely(SlabDebug(c->page)))
goto debug;

object = c->page->freelist;
c->freelist = object[c->offset];
c->page->inuse = s->objects;
c->page->freelist = NULL;
Expand Down Expand Up @@ -1542,7 +1541,6 @@ static void *__slab_alloc(struct kmem_cache *s,

return NULL;
debug:
object = c->page->freelist;
if (!alloc_debug_processing(s, c->page, object, addr))
goto another_slab;

Expand Down

0 comments on commit 7693143

Please sign in to comment.