]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
slub: Calculate min_objects based on number of processors.
authorChristoph Lameter <clameter@sgi.com>
Mon, 14 Apr 2008 16:11:41 +0000 (19:11 +0300)
committerPekka Enberg <penberg@cs.helsinki.fi>
Sun, 27 Apr 2008 15:28:40 +0000 (18:28 +0300)
commit9b2cd506e5f2117f94c28a0040bf5da058105316
tree670857a0cea6723124301901cb5261811c64d701
parent114e9e89e668ec561c9b0f3dea7bcc8af7c29d21
slub: Calculate min_objects based on number of processors.

The mininum objects per slab is calculated based on the number of processors
that may come online.

Processors    min_objects
---------------------------
1             8
2             12
4             16
8             20
16            24
32            28
64            32
1024          48
4096          56

The higher the number of processors the large the order sizes used for various
slab caches will become. This has been shown to address the performance issues
in hackbench on 16p etc.

The calculation is only performed if slub_min_objects is zero (default). If one
specifies a slub_min_objects on boot then that setting is taken.

As suggested by Zhang Yanmin's performance tests on 16-core Tigerton, use the
formula '4 * (fls(nr_cpu_ids) + 1)':

  ./hackbench 100 process 2000:

  1) 2.6.25-rc6slab: 23.5 seconds
  2) 2.6.25-rc7SLUB+slub_min_objects=20: 31 seconds
  3) 2.6.25-rc7SLUB+slub_min_objects=24: 23.5 seconds

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
mm/slub.c