lkml.org 
[lkml]   [2009]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 12/12] sched: Consolidate definition of variable sd in __build_sched_domains

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
---
kernel/sched.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 1933641..1c574ff 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -8784,6 +8784,7 @@ static int __build_sched_domains(const struct cpumask *cpu_map,
{
enum s_alloc alloc_state = sa_none;
struct s_data d;
+ struct sched_domain *sd;
int i;
#ifdef CONFIG_NUMA
d.sd_allnodes = 0;
@@ -8798,8 +8799,6 @@ static int __build_sched_domains(const struct cpumask *cpu_map,
* Set up domains for cpus specified by the cpu_map.
*/
for_each_cpu(i, cpu_map) {
- struct sched_domain *sd;
-
cpumask_and(d.nodemask, cpumask_of_node(cpu_to_node(i)),
cpu_map);

@@ -8831,22 +8830,19 @@ 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) {
- struct sched_domain *sd = &per_cpu(cpu_domains, i).sd;
-
+ sd = &per_cpu(cpu_domains, i).sd;
init_sched_groups_power(i, sd);
}
#endif
#ifdef CONFIG_SCHED_MC
for_each_cpu(i, cpu_map) {
- struct sched_domain *sd = &per_cpu(core_domains, i).sd;
-
+ sd = &per_cpu(core_domains, i).sd;
init_sched_groups_power(i, sd);
}
#endif

for_each_cpu(i, cpu_map) {
- struct sched_domain *sd = &per_cpu(phys_domains, i).sd;
-
+ sd = &per_cpu(phys_domains, i).sd;
init_sched_groups_power(i, sd);
}

@@ -8865,7 +8861,6 @@ static int __build_sched_domains(const struct cpumask *cpu_map,

/* Attach the domains */
for_each_cpu(i, cpu_map) {
- struct sched_domain *sd;
#ifdef CONFIG_SCHED_SMT
sd = &per_cpu(cpu_domains, i).sd;
#elif defined(CONFIG_SCHED_MC)
--
1.6.4




\
 
 \ /
  Last update: 2009-08-18 13:05    [W:0.177 / U:5.280 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site