diff options
author | Jack Steiner <steiner@sgi.com> | 2010-05-26 17:42:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:44 -0400 |
commit | 0ac0c0d0f837c499afd02a802f9cf52d3027fa3b (patch) | |
tree | c20a7306d4b727722556af1aa5565855686aee07 /kernel/fork.c | |
parent | 6adef3ebe570bcde67fd6c16101451ddde5712b5 (diff) |
cpusets: randomize node rotor used in cpuset_mem_spread_node()
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.
[akpm@linux-foundation.org: fix layout]
[Lee.Schermerhorn@hp.com: Define stub numa_random() for !NUMA configuration]
Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: 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>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 4d57d9e3a6e9..2e9cc3139ec6 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1079,6 +1079,10 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1079 | } | 1079 | } |
1080 | mpol_fix_fork_child_flag(p); | 1080 | mpol_fix_fork_child_flag(p); |
1081 | #endif | 1081 | #endif |
1082 | #ifdef CONFIG_CPUSETS | ||
1083 | p->cpuset_mem_spread_rotor = node_random(p->mems_allowed); | ||
1084 | p->cpuset_slab_spread_rotor = node_random(p->mems_allowed); | ||
1085 | #endif | ||
1082 | #ifdef CONFIG_TRACE_IRQFLAGS | 1086 | #ifdef CONFIG_TRACE_IRQFLAGS |
1083 | p->irq_events = 0; | 1087 | p->irq_events = 0; |
1084 | #ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW | 1088 | #ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW |