summaryrefslogtreecommitdiffstats
path: root/include/linux/slub_def.h
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-10-16 01:26:06 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 09:43:01 -0700
commitb3fba8da653999c67d7517050f196e92da6f8d3b (patch)
tree12ee00ca91ceafe4fa9bb75d62debaf1feebb7b9 /include/linux/slub_def.h
parent8e65d24c7caf2a4c69b3ae0ce170bf3082ba359f (diff)
downloadlinux-b3fba8da653999c67d7517050f196e92da6f8d3b.tar.gz
linux-b3fba8da653999c67d7517050f196e92da6f8d3b.tar.bz2
linux-b3fba8da653999c67d7517050f196e92da6f8d3b.zip
SLUB: Move page->offset to kmem_cache_cpu->offset
We need the offset from the page struct during slab_alloc and slab_free. In both cases we also reference the cacheline of the kmem_cache_cpu structure. We can therefore move the offset field into the kmem_cache_cpu structure freeing up 16 bits in the page struct. Moving the offset allows an allocation from slab_alloc() without touching the page struct in the hot path. The only thing left in slab_free() that touches the page struct cacheline for per cpu freeing is the checking of SlabDebug(page). The next patch deals with that. Use the available 16 bits to broaden page->inuse. More than 64k objects per slab become possible and we can get rid of the checks for that limitation. No need anymore to shrink the order of slabs if we boot with 2M sized slabs (slub_min_order=9). No need anymore to switch off the offset calculation for very large slabs since the field in the kmem_cache_cpu structure is 32 bits and so the offset field can now handle slab sizes of up to 8GB. 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 0a7ae25f7e8d..92e10cf6d0e8 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -15,6 +15,7 @@ struct kmem_cache_cpu {
void **freelist;
struct page *page;
int node;
+ unsigned int offset;
/* Lots of wasted space */
} ____cacheline_aligned_in_smp;