[PATCH] scheduler: NUMA aware placement of sched_group_allnodes When the per cpu sched domains are build then they also need to be placed on the node where the cpu resides otherwise we will have frequent off node accesses which will slow down the system. Signed-off-by: Christoph Lameter Index: linux-2.6.18-rc6-mm2/kernel/sched.c =================================================================== --- linux-2.6.18-rc6-mm2.orig/kernel/sched.c 2006-09-13 20:00:48.000000000 -0500 +++ linux-2.6.18-rc6-mm2/kernel/sched.c 2006-09-15 13:05:32.269416181 -0500 @@ -6449,9 +6449,10 @@ static int build_sched_domains(const cpu > SD_NODES_PER_DOMAIN*cpus_weight(nodemask)) { if (!sched_group_allnodes) { sched_group_allnodes - = kmalloc(sizeof(struct sched_group) - * MAX_NUMNODES, - GFP_KERNEL); + = kmalloc_node(sizeof(struct sched_group) + * MAX_NUMNODES, + GFP_KERNEL, + cpu_to_node(i)); if (!sched_group_allnodes) { printk(KERN_WARNING "Can not alloc allnodes sched group\n");