Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245549
b: refs/heads/master
c: 1cf5190
h: refs/heads/master
i:
  245547: b74251d
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 11, 2011
1 parent fe7d78e commit 52869b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3739494e08da50c8a68d65eed5ba3012a54b40d4
refs/heads/master: 1cf51902546d60b8a7a6aba2dd557bd4ba8840ea
24 changes: 5 additions & 19 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -7231,15 +7231,12 @@ static struct sched_domain *__build_smt_sched_domain(struct s_data *d,
return sd;
}

static void build_sched_groups(struct s_data *d, enum sched_domain_level l,
static void build_sched_groups(struct s_data *d, struct sched_domain *sd,
const struct cpumask *cpu_map, int cpu)
{
struct sched_domain *sd;

switch (l) {
switch (sd->level) {
#ifdef CONFIG_SCHED_SMT
case SD_LV_SIBLING: /* set up CPU (sibling) groups */
sd = &per_cpu(cpu_domains, cpu).sd;
if (cpu == cpumask_first(sched_domain_span(sd)))
init_sched_build_groups(sched_domain_span(sd), cpu_map,
&cpu_to_cpu_group,
Expand All @@ -7248,7 +7245,6 @@ static void build_sched_groups(struct s_data *d, enum sched_domain_level l,
#endif
#ifdef CONFIG_SCHED_MC
case SD_LV_MC: /* set up multi-core groups */
sd = &per_cpu(core_domains, cpu).sd;
if (cpu == cpumask_first(sched_domain_span(sd)))
init_sched_build_groups(sched_domain_span(sd), cpu_map,
&cpu_to_core_group,
Expand All @@ -7257,23 +7253,20 @@ static void build_sched_groups(struct s_data *d, enum sched_domain_level l,
#endif
#ifdef CONFIG_SCHED_BOOK
case SD_LV_BOOK: /* set up book groups */
sd = &per_cpu(book_domains, cpu).sd;
if (cpu == cpumask_first(sched_domain_span(sd)))
init_sched_build_groups(sched_domain_span(sd), cpu_map,
&cpu_to_book_group,
d->send_covered, d->tmpmask);
break;
#endif
case SD_LV_CPU: /* set up physical groups */
sd = &per_cpu(phys_domains, cpu).sd;
if (cpu == cpumask_first(sched_domain_span(sd)))
init_sched_build_groups(sched_domain_span(sd), cpu_map,
&cpu_to_phys_group,
d->send_covered, d->tmpmask);
break;
#ifdef CONFIG_NUMA
case SD_LV_NODE:
sd = &per_cpu(node_domains, cpu).sd;
if (cpu == cpumask_first(sched_domain_span(sd)))
init_sched_build_groups(sched_domain_span(sd), cpu_map,
&cpu_to_node_group,
Expand Down Expand Up @@ -7323,17 +7316,10 @@ static int __build_sched_domains(const struct cpumask *cpu_map,
sd = __build_mc_sched_domain(&d, cpu_map, attr, sd, i);
sd = __build_smt_sched_domain(&d, cpu_map, attr, sd, i);

for (tmp = sd; tmp; tmp = tmp->parent)
for (tmp = sd; tmp; tmp = tmp->parent) {
tmp->span_weight = cpumask_weight(sched_domain_span(tmp));
}

for_each_cpu(i, cpu_map) {
build_sched_groups(&d, SD_LV_SIBLING, cpu_map, i);
build_sched_groups(&d, SD_LV_BOOK, cpu_map, i);
build_sched_groups(&d, SD_LV_MC, cpu_map, i);
build_sched_groups(&d, SD_LV_CPU, cpu_map, i);
build_sched_groups(&d, SD_LV_NODE, cpu_map, i);
build_sched_groups(&d, SD_LV_ALLNODES, cpu_map, i);
build_sched_groups(&d, tmp, cpu_map, i);
}
}

/* Calculate CPU power for physical packages and nodes */
Expand Down

0 comments on commit 52869b0

Please sign in to comment.