]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
SLUB: Use ->objsize from struct kmem_cache_cpu in slab_free()
authorPekka Enberg <penberg@cs.helsinki.fi>
Wed, 14 Jan 2009 10:22:25 +0000 (12:22 +0200)
committerPekka Enberg <penberg@cs.helsinki.fi>
Wed, 14 Jan 2009 15:04:59 +0000 (17:04 +0200)
There's no reason to use ->objsize from struct kmem_cache in slab_free() for
the SLAB_DEBUG_OBJECTS case. All it does is generate extra cache pressure as we
try very hard not to touch struct kmem_cache in the fast-path.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
mm/slub.c

index 6392ae5cc6b1e8972d98b059bee576aeb66d366c..f21e25ad453bee8b96aa5861b014bd9e89df2e2e 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1724,7 +1724,7 @@ static __always_inline void slab_free(struct kmem_cache *s,
        c = get_cpu_slab(s, smp_processor_id());
        debug_check_no_locks_freed(object, c->objsize);
        if (!(s->flags & SLAB_DEBUG_OBJECTS))
-               debug_check_no_obj_freed(object, s->objsize);
+               debug_check_no_obj_freed(object, c->objsize);
        if (likely(page == c->page && c->node >= 0)) {
                object[c->offset] = c->freelist;
                c->freelist = object;