aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bitmap.c
diff options
context:
space:
mode:
authorMichal Hocko <[email protected]>2011-07-26 23:08:30 +0000
committerLinus Torvalds <[email protected]>2011-07-26 23:49:43 +0000
commit778d3b0ff0654ad7092bf823fd32010066b12365 (patch)
treecd0073d8c513e1c56fd6950c4ec985f16fd004ad /lib/bitmap.c
parentmemcg: get rid of percpu_charge_mutex lock (diff)
downloadkernel-778d3b0ff0654ad7092bf823fd32010066b12365.tar.gz
kernel-778d3b0ff0654ad7092bf823fd32010066b12365.zip
cpusets: randomize node rotor used in cpuset_mem_spread_node()
[ This patch has already been accepted as commit 0ac0c0d0f837 but later reverted (commit 35926ff5fba8) because it itroduced arch specific __node_random which was defined only for x86 code so it broke other archs. This is a followup without any arch specific code. Other than that there are no functional changes.] Some workloads that create a large number of small files tend to assign too many pages to node 0 (multi-node systems). Part of the reason is that the rotor (in cpuset_mem_spread_node()) used to assign nodes starts at node 0 for newly created tasks. This patch changes the rotor to be initialized to a random node number of the cpuset. [[email protected]: fix layout] [[email protected]: Define stub numa_random() for !NUMA configuration] [[email protected]: Make it arch independent] [[email protected]: fix CONFIG_NUMA=y, MAX_NUMNODES>1 build] Signed-off-by: Jack Steiner <[email protected]> Signed-off-by: Lee Schermerhorn <[email protected]> Signed-off-by: Michal Hocko <[email protected]> Reviewed-by: KOSAKI Motohiro <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Paul Menage <[email protected]> Cc: Jack Steiner <[email protected]> Cc: Robin Holt <[email protected]> Cc: David Rientjes <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: David Rientjes <[email protected]> Cc: Jack Steiner <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Lee Schermerhorn <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Paul Menage <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Robin Holt <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/bitmap.c')
-rw-r--r--lib/bitmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 3f3b68199d74..37ef4b048795 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -756,7 +756,7 @@ static int bitmap_pos_to_ord(const unsigned long *buf, int pos, int bits)
*
* The bit positions 0 through @bits are valid positions in @buf.
*/
-static int bitmap_ord_to_pos(const unsigned long *buf, int ord, int bits)
+int bitmap_ord_to_pos(const unsigned long *buf, int ord, int bits)
{
int pos = 0;