Commit 6047a007 authored by Pekka Enberg's avatar Pekka Enberg

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: default avatarPekka Enberg <penberg@cs.helsinki.fi>
parent a6525042
...@@ -1724,7 +1724,7 @@ static __always_inline void slab_free(struct kmem_cache *s, ...@@ -1724,7 +1724,7 @@ static __always_inline void slab_free(struct kmem_cache *s,
c = get_cpu_slab(s, smp_processor_id()); c = get_cpu_slab(s, smp_processor_id());
debug_check_no_locks_freed(object, c->objsize); debug_check_no_locks_freed(object, c->objsize);
if (!(s->flags & SLAB_DEBUG_OBJECTS)) 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)) { if (likely(page == c->page && c->node >= 0)) {
object[c->offset] = c->freelist; object[c->offset] = c->freelist;
c->freelist = object; c->freelist = object;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment