diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-04-14 18:53:02 +0300 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2008-04-14 18:53:02 +0300 |
commit | 0f389ec63077521166f071e1e970aed36147fd45 (patch) | |
tree | b1f2159c652c48160dde31e6740870ae0589dffb /include/linux/slub_def.h | |
parent | 49bd5221ce8fb55d12c04a3ffd375201c5bbfb7a (diff) | |
download | linux-0f389ec63077521166f071e1e970aed36147fd45.tar.gz linux-0f389ec63077521166f071e1e970aed36147fd45.tar.bz2 linux-0f389ec63077521166f071e1e970aed36147fd45.zip |
slub: No need for per node slab counters if !SLUB_DEBUG
The per node counters are used mainly for showing data through the sysfs API.
If that API is not compiled in then there is no point in keeping track of this
data. Disable counters for the number of slabs and the number of total slabs
if !SLUB_DEBUG. Incrementing the per node counters is also accessing a
potentially contended cacheline so this could actually be a performance
benefit to embedded systems.
SLABINFO support is also affected. It now must depends on SLUB_DEBUG (which
is on by default).
Patch also avoids a check for a NULL kmem_cache_node pointer in new_slab()
if the system is not compiled with NUMA support.
[penberg@cs.helsinki.fi: fix oops and move ->nr_slabs into CONFIG_SLUB_DEBUG]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'include/linux/slub_def.h')
-rw-r--r-- | include/linux/slub_def.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index b00c1c73eb0a..79d59c937fac 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -45,9 +45,9 @@ struct kmem_cache_cpu { struct kmem_cache_node { spinlock_t list_lock; /* Protect partial list and nr_partial */ unsigned long nr_partial; - atomic_long_t nr_slabs; struct list_head partial; #ifdef CONFIG_SLUB_DEBUG + atomic_long_t nr_slabs; struct list_head full; #endif }; |