Index: linux-2.6.19-rc2-mm1/kernel/sched.c =================================================================== --- linux-2.6.19-rc2-mm1.orig/kernel/sched.c 2006-10-17 22:25:48.000000000 -0500 +++ linux-2.6.19-rc2-mm1/kernel/sched.c 2006-10-17 23:43:38.793789849 -0500 @@ -5643,9 +5643,8 @@ __setup ("isolcpus=", isolated_cpu_setup * covered by the given span, and will set each group's ->cpumask correctly, * and ->cpu_power to 0. */ -static void -init_sched_build_groups(struct sched_group groups[], cpumask_t span, - const cpumask_t *cpu_map, +static struct sched_groups * +init_sched_build_groups(cpumask_t span, const cpumask_t *cpu_map, int (*group_fn)(int cpu, const cpumask_t *cpu_map)) { struct sched_group *first = NULL, *last = NULL; @@ -5654,12 +5653,15 @@ init_sched_build_groups(struct sched_gro for_each_cpu_mask(i, span) { int group = group_fn(i, cpu_map); - struct sched_group *sg = &groups[group]; + struct sched_group *sg; int j; if (cpu_isset(i, covered)) continue; + sg = kmalloc(sizeof(struct sched_groups), + GFP_KERNEL, cpu_to_node(i)); + BUG_ON(!sg); sg->cpumask = CPU_MASK_NONE; sg->cpu_power = 0; @@ -5677,6 +5679,7 @@ init_sched_build_groups(struct sched_gro last = sg; } last->next = first; + return first; } #define SD_NODES_PER_DOMAIN 16 @@ -6509,7 +6512,6 @@ static int build_sched_domains(const cpu sd->parent = p; if (p) p->child = sd; - sd->groups = &sched_group_phys[group]; #ifdef CONFIG_SCHED_MC p = sd; @@ -6554,10 +6556,12 @@ static int build_sched_domains(const cpu for_each_cpu_mask(i, *cpu_map) { cpumask_t this_core_map = cpu_coregroup_map(i); cpus_and(this_core_map, this_core_map, *cpu_map); - if (i != first_cpu(this_core_map)) - continue; + if (i == first_cpu(this_core_map)) + per_cpu(phs_map,i).groups = init_sched_build_groups(sched_group_core, this_core_map, cpu_map, &cpu_to_core_group); + else + per_cpu(phys_map, i).groups = walk(grouparr, nthbit(this_core_map)); } #endif