aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slub_def.h
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2011-03-10 02:21:48 -0500
committerPekka Enberg <penberg@kernel.org>2011-03-11 11:06:34 -0500
commitab9a0f196f2f4f080df54402493ea3dc31b5243e (patch)
tree849ce2a8bf2c2574b8ea9a368873aebfb25186b0 /include/linux/slub_def.h
parenta5abba989deceb731047425812d268daf7536575 (diff)
slub: automatically reserve bytes at the end of slab
There is no "struct" for slub's slab, it shares with struct page. But struct page is very small, it is insufficient when we need to add some metadata for slab. So we add a field "reserved" to struct kmem_cache, when a slab is allocated, kmem_cache->reserved bytes are automatically reserved at the end of the slab for slab's metadata. Changed from v1: Export the reserved field via sysfs Acked-by: Christoph Lameter <cl@linux.com> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Pekka Enberg <penberg@kernel.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 8b6e8ae5d5ca..ae0093cc5189 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -83,6 +83,7 @@ struct kmem_cache {
83 void (*ctor)(void *); 83 void (*ctor)(void *);
84 int inuse; /* Offset to metadata */ 84 int inuse; /* Offset to metadata */
85 int align; /* Alignment */ 85 int align; /* Alignment */
86 int reserved; /* Reserved bytes at the end of slabs */
86 unsigned long min_partial; 87 unsigned long min_partial;
87 const char *name; /* Name (only for display!) */ 88 const char *name; /* Name (only for display!) */
88 struct list_head list; /* List of slab caches */ 89 struct list_head list; /* List of slab caches */