From: Pekka Enberg Date: Wed, 14 Jan 2009 10:22:25 +0000 (+0200) Subject: SLUB: Use ->objsize from struct kmem_cache_cpu in slab_free() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6047a007d0f6b7395cd158f3bdda34ab39a48821;p=linux-beck.git SLUB: Use ->objsize from struct kmem_cache_cpu in slab_free() 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 --- diff --git a/mm/slub.c b/mm/slub.c index 6392ae5cc6b1..f21e25ad453b 100644 --- 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;