aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slub_def.h
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-10-16 01:26:09 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 09:43:01 -0700
commit42a9fdbb12ac6c027b4b91ab9b5a60aa3a834489 (patch)
treed319573849af86fa405b93e5b93add0d34305db7 /include/linux/slub_def.h
parentSLUB: Place kmem_cache_cpu structures in a NUMA aware way (diff)
downloadlinux-dev-42a9fdbb12ac6c027b4b91ab9b5a60aa3a834489.tar.xz
linux-dev-42a9fdbb12ac6c027b4b91ab9b5a60aa3a834489.zip
SLUB: Optimize cacheline use for zeroing
We touch a cacheline in the kmem_cache structure for zeroing to get the size. However, the hot paths in slab_alloc and slab_free do not reference any other fields in kmem_cache, so we may have to just bring in the cacheline for this one access. Add a new field to kmem_cache_cpu that contains the object size. That cacheline must already be used in the hotpaths. So we save one cacheline on every slab_alloc if we zero. We need to update the kmem_cache_cpu object size if an aliasing operation changes the objsize of an non debug slab. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/slub_def.h')
-rw-r--r--include/linux/slub_def.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index f74716b59ce2..d65159d1d4f5 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -16,6 +16,7 @@ struct kmem_cache_cpu {
struct page *page;
int node;
unsigned int offset;
+ unsigned int objsize;
};
struct kmem_cache_node {