]> git.baikalelectronics.ru Git - kernel.git/commit
slub: Dynamically size kmalloc cache allocations
authorChristoph Lameter <cl@linux.com>
Fri, 20 Aug 2010 17:37:15 +0000 (12:37 -0500)
committerPekka Enberg <penberg@kernel.org>
Sat, 2 Oct 2010 07:24:27 +0000 (10:24 +0300)
commit4eda1b23c7c3a9bd48a66c4c4d115f84210cb438
treee2827e87486675b514c68f06d67ac5980cd6ceb1
parent5f8ca534db142c8b8f558105cbcf9318972181f9
slub: Dynamically size kmalloc cache allocations

kmalloc caches are statically defined and may take up a lot of space just
because the sizes of the node array has to be dimensioned for the largest
node count supported.

This patch makes the size of the kmem_cache structure dynamic throughout by
creating a kmem_cache slab cache for the kmem_cache objects. The bootstrap
occurs by allocating the initial one or two kmem_cache objects from the
page allocator.

C2->C3
- Fix various issues indicated by David
- Make create kmalloc_cache return a kmem_cache * pointer.

Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
include/linux/slub_def.h
mm/slub.c