]> git.baikalelectronics.ru Git - kernel.git/commit
slub: automatically reserve bytes at the end of slab
authorLai Jiangshan <laijs@cn.fujitsu.com>
Thu, 10 Mar 2011 07:21:48 +0000 (15:21 +0800)
committerPekka Enberg <penberg@kernel.org>
Fri, 11 Mar 2011 16:06:34 +0000 (18:06 +0200)
commit9ae4c86f6ec20aba0953add67cdfcbb385a85646
tree849ce2a8bf2c2574b8ea9a368873aebfb25186b0
parent80e7c449e8b9ba334a4a21064a0b0281b9f62f70
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>
include/linux/slub_def.h
mm/slub.c