Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245545
b: refs/heads/master
c: d274cb3
h: refs/heads/master
i:
  245543: b3ce38e
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 11, 2011
1 parent ba39056 commit ce36467
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 40 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: c4a8849af939082052d8117f9ea3e170a99ff232
refs/heads/master: d274cb30f4a08045492d3f0c47cdf1a25668b1f5
44 changes: 5 additions & 39 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -6679,9 +6679,6 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
struct rq *rq = cpu_rq(cpu);
struct sched_domain *tmp;

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

/* Remove the sched domains which do not contribute to scheduling. */
for (tmp = sd; tmp; ) {
struct sched_domain *parent = tmp->parent;
Expand Down Expand Up @@ -7159,48 +7156,14 @@ static void free_sched_groups(const struct cpumask *cpu_map,
*/
static void init_sched_groups_power(int cpu, struct sched_domain *sd)
{
struct sched_domain *child;
struct sched_group *group;
long power;
int weight;

WARN_ON(!sd || !sd->groups);

if (cpu != group_first_cpu(sd->groups))
return;

sd->groups->group_weight = cpumask_weight(sched_group_cpus(sd->groups));

child = sd->child;

sd->groups->cpu_power = 0;

if (!child) {
power = SCHED_LOAD_SCALE;
weight = cpumask_weight(sched_domain_span(sd));
/*
* SMT siblings share the power of a single core.
* Usually multiple threads get a better yield out of
* that one core than a single thread would have,
* reflect that in sd->smt_gain.
*/
if ((sd->flags & SD_SHARE_CPUPOWER) && weight > 1) {
power *= sd->smt_gain;
power /= weight;
power >>= SCHED_LOAD_SHIFT;
}
sd->groups->cpu_power += power;
return;
}

/*
* Add cpu_power of each child group to this groups cpu_power.
*/
group = child->groups;
do {
sd->groups->cpu_power += group->cpu_power;
group = group->next;
} while (group != child->groups);
update_group_power(sd, cpu);
}

/*
Expand Down Expand Up @@ -7507,7 +7470,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;
struct sched_domain *sd, *tmp;
int i;
#ifdef CONFIG_NUMA
d.sd_allnodes = 0;
Expand All @@ -7530,6 +7493,9 @@ static int __build_sched_domains(const struct cpumask *cpu_map,
sd = __build_book_sched_domain(&d, cpu_map, attr, sd, i);
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)
tmp->span_weight = cpumask_weight(sched_domain_span(tmp));
}

for_each_cpu(i, cpu_map) {
Expand Down

0 comments on commit ce36467

Please sign in to comment.