From ce164428c4cabfd284ca81913415cacd889aac33 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Tue, 3 Oct 2006 01:14:11 -0700 Subject: [PATCH] [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 Acked-by: Ingo Molnar Acked-by: Nick Piggin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/sched.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/sched.c b/kernel/sched.c index fec97e4e196d..53608a59d6e3 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -6349,9 +6349,10 @@ static int build_sched_domains(const cpumask_t *cpu_map) > 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");