lkml.org 
[lkml]   [2009]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] SLUB: Use ->objsize from struct kmem_cache_cpu in slab_free()
From: Pekka Enberg <penberg@cs.helsinki.fi>

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 no one else touches struct kmem_cache in the fast-path.

Not that it matters all that much as the code is optimized away when
CONFIG_DEBUG_OBJECTS is disabled and when it is enabled, the
actual debugging checks are quite heavy-weight.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
mm/slub.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 57aa749..fa651c1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1727,7 +1727,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;
--
1.5.4.3


\
 
 \ /
  Last update: 2009-01-14 11:31    [W:0.021 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site