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)
commit51df1142816e469173889fb6d6dc810be9b9e022
treee2827e87486675b514c68f06d67ac5980cd6ceb1
parent6c182dc0de26ef97efb6a97a8deab074833764e7
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