slub: look up object from the freelist once
authorPekka J Enberg <penberg@cs.helsinki.fi>
Sat, 1 Mar 2008 21:43:54 +0000 (13:43 -0800)
committerChristoph Lameter <clameter@sgi.com>
Mon, 3 Mar 2008 20:22:32 +0000 (12:22 -0800)
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>
mm/slub.c

index 10d546954efa81e6cf1c46b8376842ed7754a06b..db8026ba049f630a6500262fc9c1d9f7f11c9f7a 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1486,7 +1486,6 @@ load_freelist:
        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;
@@ -1542,7 +1541,6 @@ new_slab:
 
        return NULL;
 debug:
-       object = c->page->freelist;
        if (!alloc_debug_processing(s, c->page, object, addr))
                goto another_slab;