diff options
author | Andreas Herrmann <andreas.herrmann3@amd.com> | 2009-08-18 06:54:55 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-18 12:35:40 -0400 |
commit | 87cce6622c2ab2f0e96ecc2a37133378a7db3177 (patch) | |
tree | b4be2ff280b330b0050c27117aa69a7f19cfdaa8 /kernel/sched.c | |
parent | 7f4588f3aa395632fec9ba2e15a1920f0682fda0 (diff) |
sched: Separate out build of CPU sched domain from __build_sched_domains
... to further strip down __build_sched_domains().
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20090818105455.GE29515@alberich.amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index dd95a4708370..3d0666c5e026 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -8513,6 +8513,22 @@ static struct sched_domain *__build_numa_sched_domains(struct s_data *d, | |||
8513 | return sd; | 8513 | return sd; |
8514 | } | 8514 | } |
8515 | 8515 | ||
8516 | static struct sched_domain *__build_cpu_sched_domain(struct s_data *d, | ||
8517 | const struct cpumask *cpu_map, struct sched_domain_attr *attr, | ||
8518 | struct sched_domain *parent, int i) | ||
8519 | { | ||
8520 | struct sched_domain *sd; | ||
8521 | sd = &per_cpu(phys_domains, i).sd; | ||
8522 | SD_INIT(sd, CPU); | ||
8523 | set_domain_attribute(sd, attr); | ||
8524 | cpumask_copy(sched_domain_span(sd), d->nodemask); | ||
8525 | sd->parent = parent; | ||
8526 | if (parent) | ||
8527 | parent->child = sd; | ||
8528 | cpu_to_phys_group(i, cpu_map, &sd->groups, d->tmpmask); | ||
8529 | return sd; | ||
8530 | } | ||
8531 | |||
8516 | /* | 8532 | /* |
8517 | * Build sched domains for a given set of cpus and attach the sched domains | 8533 | * Build sched domains for a given set of cpus and attach the sched domains |
8518 | * to the individual cpus | 8534 | * to the individual cpus |
@@ -8542,15 +8558,7 @@ static int __build_sched_domains(const struct cpumask *cpu_map, | |||
8542 | cpu_map); | 8558 | cpu_map); |
8543 | 8559 | ||
8544 | sd = __build_numa_sched_domains(&d, cpu_map, attr, i); | 8560 | sd = __build_numa_sched_domains(&d, cpu_map, attr, i); |
8545 | p = sd; | 8561 | sd = __build_cpu_sched_domain(&d, cpu_map, attr, sd, i); |
8546 | sd = &per_cpu(phys_domains, i).sd; | ||
8547 | SD_INIT(sd, CPU); | ||
8548 | set_domain_attribute(sd, attr); | ||
8549 | cpumask_copy(sched_domain_span(sd), d.nodemask); | ||
8550 | sd->parent = p; | ||
8551 | if (p) | ||
8552 | p->child = sd; | ||
8553 | cpu_to_phys_group(i, cpu_map, &sd->groups, d.tmpmask); | ||
8554 | 8562 | ||
8555 | #ifdef CONFIG_SCHED_MC | 8563 | #ifdef CONFIG_SCHED_MC |
8556 | p = sd; | 8564 | p = sd; |