]> git.baikalelectronics.ru Git - kernel.git/commit
slab: shrink sizeof(struct kmem_cache)
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 20 Jul 2011 17:04:23 +0000 (19:04 +0200)
committerPekka Enberg <penberg@kernel.org>
Wed, 20 Jul 2011 17:27:56 +0000 (20:27 +0300)
commitd852a2a5944985e3cd8822c3560f8a8dc7a96f58
treee1de7ba007c79042d30454c11b78aa942e2666b3
parentb35782c1d2321f041a4dcd76a99dc29e0e08a9f8
slab: shrink sizeof(struct kmem_cache)

Reduce high order allocations for some setups.
(NR_CPUS=4096 -> we need 64KB per kmem_cache struct)

We now allocate exact needed size (using nr_cpu_ids and nr_node_ids)

This also makes code a bit smaller on x86_64, since some field offsets
are less than the 127 limit :

Before patch :
# size mm/slab.o
   text    data     bss     dec     hex filename
  22605  361665      32  384302   5dd2e mm/slab.o

After patch :
# size mm/slab.o
   text    data     bss     dec     hex filename
  22349  353473    8224  384046   5dc2e mm/slab.o

CC: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
include/linux/slab_def.h
mm/slab.c