Jack Steiner 6adef3ebe5 cpusets: new round-robin rotor for SLAB allocations
We have observed several workloads running on multi-node systems where
memory is assigned unevenly across the nodes in the system.  There are
numerous reasons for this but one is the round-robin rotor in
cpuset_mem_spread_node().

For example, a simple test that writes a multi-page file will allocate
pages on nodes 0 2 4 6 ...  Odd nodes are skipped.  (Sometimes it
allocates on odd nodes & skips even nodes).

An example is shown below.  The program "lfile" writes a file consisting
of 10 pages.  The program then mmaps the file & uses get_mempolicy(...,
MPOL_F_NODE) to determine the nodes where the file pages were allocated.
The output is shown below:

	# ./lfile
	 allocated on nodes: 2 4 6 0 1 2 6 0 2

There is a single rotor that is used for allocating both file pages & slab
pages.  Writing the file allocates both a data page & a slab page
(buffer_head).  This advances the RR rotor 2 nodes for each page
allocated.

A quick confirmation seems to confirm this is the cause of the uneven
allocation:

	# echo 0 >/dev/cpuset/memory_spread_slab
	# ./lfile
	 allocated on nodes: 6 7 8 9 0 1 2 3 4 5

This patch introduces a second rotor that is used for slab allocations.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Acked-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Paul Menage <menage@google.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Robin Holt <holt@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-27 09:12:44 -07:00
..
2010-05-17 22:39:48 -07:00
2010-05-03 08:33:00 -04:00
2010-03-12 15:53:10 -08:00
2010-05-14 17:08:01 -04:00
2010-05-19 13:38:54 -04:00
2010-03-12 15:52:32 -08:00
2010-05-10 16:08:01 -07:00
2010-05-17 16:30:58 -07:00
2010-05-21 19:30:44 +02:00
2010-04-09 08:36:07 +02:00
2010-03-16 08:55:32 +01:00
2010-05-25 08:07:01 -07:00
2010-05-27 09:12:42 -07:00
2010-05-21 09:34:29 -07:00
2010-03-07 22:17:09 +01:00
2010-03-02 12:23:42 +01:00
2010-03-12 15:52:36 -08:00
2010-05-11 12:01:10 -07:00
2010-03-12 15:52:40 -08:00
2010-05-11 14:40:55 +02:00
2010-05-03 11:50:57 +02:00
2010-04-23 02:08:44 +02:00
2010-03-12 15:53:10 -08:00
2010-05-21 09:37:29 -07:00
2010-05-14 15:09:32 -04:00
2010-05-17 12:17:10 +03:00
2010-04-03 14:56:05 -07:00
2010-02-19 03:35:12 -05:00
2010-03-12 15:52:28 -08:00
2010-05-11 14:40:55 +02:00
2010-04-13 14:49:34 -07:00
2010-05-17 05:27:42 +02:00
2010-05-19 13:44:27 +10:00
2010-04-02 14:30:39 -07:00
2010-05-10 23:08:19 +02:00
2010-03-12 15:53:11 -08:00
2010-05-21 19:30:44 +02:00
2010-05-03 15:53:54 -07:00
2010-03-12 15:52:44 -08:00
2010-03-02 14:28:49 -05:00
2010-05-11 10:09:47 +02:00
2010-03-12 15:53:10 -08:00
2010-05-06 10:56:07 +10:00
2010-03-12 15:52:44 -08:00
2010-05-17 17:18:50 -07:00
2010-04-03 15:09:04 -07:00
2010-05-10 11:08:35 -07:00
2010-05-27 09:12:43 -07:00
2010-05-15 23:28:39 -07:00
2010-02-18 15:43:09 -08:00
2010-03-25 17:18:43 -07:00
2010-04-13 12:43:42 +02:00
2010-03-23 17:19:38 +01:00
2010-05-12 23:02:23 -07:00
2010-05-21 09:34:29 -07:00
2010-05-19 22:15:46 +09:30
2010-04-06 20:35:58 +04:00