diff options
author | Andreas Herrmann <andreas.herrmann3@amd.com> | 2009-08-18 07:02:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-18 12:35:45 -0400 |
commit | 294b0c9619a0469a3b385b6fc47e79f64222a692 (patch) | |
tree | cd4bac990239aa7c2fc5549bca43c2282ba362b8 | |
parent | 0601a88d8fa4508eaa49a6d96c6685e1dece38e3 (diff) |
sched: Consolidate definition of variable sd in __build_sched_domains
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20090818110229.GM29515@alberich.amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/sched.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index c1ce884a0163..cf4c953d6486 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -8678,6 +8678,7 @@ static int __build_sched_domains(const struct cpumask *cpu_map, | |||
8678 | { | 8678 | { |
8679 | enum s_alloc alloc_state = sa_none; | 8679 | enum s_alloc alloc_state = sa_none; |
8680 | struct s_data d; | 8680 | struct s_data d; |
8681 | struct sched_domain *sd; | ||
8681 | int i; | 8682 | int i; |
8682 | #ifdef CONFIG_NUMA | 8683 | #ifdef CONFIG_NUMA |
8683 | d.sd_allnodes = 0; | 8684 | d.sd_allnodes = 0; |
@@ -8692,8 +8693,6 @@ static int __build_sched_domains(const struct cpumask *cpu_map, | |||
8692 | * Set up domains for cpus specified by the cpu_map. | 8693 | * Set up domains for cpus specified by the cpu_map. |
8693 | */ | 8694 | */ |
8694 | for_each_cpu(i, cpu_map) { | 8695 | for_each_cpu(i, cpu_map) { |
8695 | struct sched_domain *sd; | ||
8696 | |||
8697 | cpumask_and(d.nodemask, cpumask_of_node(cpu_to_node(i)), | 8696 | cpumask_and(d.nodemask, cpumask_of_node(cpu_to_node(i)), |
8698 | cpu_map); | 8697 | cpu_map); |
8699 | 8698 | ||
@@ -8725,22 +8724,19 @@ static int __build_sched_domains(const struct cpumask *cpu_map, | |||
8725 | /* Calculate CPU power for physical packages and nodes */ | 8724 | /* Calculate CPU power for physical packages and nodes */ |
8726 | #ifdef CONFIG_SCHED_SMT | 8725 | #ifdef CONFIG_SCHED_SMT |
8727 | for_each_cpu(i, cpu_map) { | 8726 | for_each_cpu(i, cpu_map) { |
8728 | struct sched_domain *sd = &per_cpu(cpu_domains, i).sd; | 8727 | sd = &per_cpu(cpu_domains, i).sd; |
8729 | |||
8730 | init_sched_groups_power(i, sd); | 8728 | init_sched_groups_power(i, sd); |
8731 | } | 8729 | } |
8732 | #endif | 8730 | #endif |
8733 | #ifdef CONFIG_SCHED_MC | 8731 | #ifdef CONFIG_SCHED_MC |
8734 | for_each_cpu(i, cpu_map) { | 8732 | for_each_cpu(i, cpu_map) { |
8735 | struct sched_domain *sd = &per_cpu(core_domains, i).sd; | 8733 | sd = &per_cpu(core_domains, i).sd; |
8736 | |||
8737 | init_sched_groups_power(i, sd); | 8734 | init_sched_groups_power(i, sd); |
8738 | } | 8735 | } |
8739 | #endif | 8736 | #endif |
8740 | 8737 | ||
8741 | for_each_cpu(i, cpu_map) { | 8738 | for_each_cpu(i, cpu_map) { |
8742 | struct sched_domain *sd = &per_cpu(phys_domains, i).sd; | 8739 | sd = &per_cpu(phys_domains, i).sd; |
8743 | |||
8744 | init_sched_groups_power(i, sd); | 8740 | init_sched_groups_power(i, sd); |
8745 | } | 8741 | } |
8746 | 8742 | ||
@@ -8759,7 +8755,6 @@ static int __build_sched_domains(const struct cpumask *cpu_map, | |||
8759 | 8755 | ||
8760 | /* Attach the domains */ | 8756 | /* Attach the domains */ |
8761 | for_each_cpu(i, cpu_map) { | 8757 | for_each_cpu(i, cpu_map) { |
8762 | struct sched_domain *sd; | ||
8763 | #ifdef CONFIG_SCHED_SMT | 8758 | #ifdef CONFIG_SCHED_SMT |
8764 | sd = &per_cpu(cpu_domains, i).sd; | 8759 | sd = &per_cpu(cpu_domains, i).sd; |
8765 | #elif defined(CONFIG_SCHED_MC) | 8760 | #elif defined(CONFIG_SCHED_MC) |