cpusets: randomize node rotor used in cpuset_mem_spread_node()
[safe/jmp/linux-2.6] / kernel / fork.c
index 4d57d9e..2e9cc31 100644 (file)
@@ -1079,6 +1079,10 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        }
        mpol_fix_fork_child_flag(p);
 #endif
+#ifdef CONFIG_CPUSETS
+       p->cpuset_mem_spread_rotor = node_random(p->mems_allowed);
+       p->cpuset_slab_spread_rotor = node_random(p->mems_allowed);
+#endif
 #ifdef CONFIG_TRACE_IRQFLAGS
        p->irq_events = 0;
 #ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW