From c73f8481113614be601e50f3a06f1f64616e844a Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Thu, 7 Apr 2011 14:09:49 +0200 Subject: [PATCH] --- yaml --- r: 245551 b: refs/heads/master c: a9c9a9b6bff27ac9c746344a9c1a19bf3327002c h: refs/heads/master i: 245549: 52869b0276d87ff792decc4c9dabe2260bca8dd7 245547: b74251dd3947ae5ca5222810e6cef5f272e164d9 245543: b3ce38e931ca7ccf3e79746f2474c2e09f295b08 245535: 3ee8572529ed0798f309893361c9e22056db91ea v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 39 +++++---------------------------------- 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/[refs] b/[refs] index 64fa12115dea..0bda6179178a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 21d42ccfd6c6c11f96c2acfd32a85cfc33514d3a +refs/heads/master: a9c9a9b6bff27ac9c746344a9c1a19bf3327002c diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index d6992bfa11eb..1cca59ec4a49 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -7334,43 +7334,14 @@ static int __build_sched_domains(const struct cpumask *cpu_map, } /* Calculate CPU power for physical packages and nodes */ -#ifdef CONFIG_SCHED_SMT - for_each_cpu(i, cpu_map) { - sd = &per_cpu(cpu_domains, i).sd; - init_sched_groups_power(i, sd); - } -#endif -#ifdef CONFIG_SCHED_MC - for_each_cpu(i, cpu_map) { - sd = &per_cpu(core_domains, i).sd; - init_sched_groups_power(i, sd); - } -#endif -#ifdef CONFIG_SCHED_BOOK - for_each_cpu(i, cpu_map) { - sd = &per_cpu(book_domains, i).sd; - init_sched_groups_power(i, sd); - } -#endif - - for_each_cpu(i, cpu_map) { - sd = &per_cpu(phys_domains, i).sd; - init_sched_groups_power(i, sd); - } - -#ifdef CONFIG_NUMA - for_each_cpu(i, cpu_map) { - sd = &per_cpu(node_domains, i).sd; - init_sched_groups_power(i, sd); - } + for (i = nr_cpumask_bits-1; i >= 0; i--) { + if (!cpumask_test_cpu(i, cpu_map)) + continue; - if (d.sd_allnodes) { - for_each_cpu(i, cpu_map) { - sd = &per_cpu(allnodes_domains, i).sd; + sd = *per_cpu_ptr(d.sd, i); + for (; sd; sd = sd->parent) init_sched_groups_power(i, sd); - } } -#endif /* Attach the domains */ for_each_cpu(i, cpu_map) {