提交 08069033 编写于 作者: S Siddha, Suresh B 提交者: Linus Torvalds

[PATCH] sched: fix group power for allnodes_domains

Current sched groups power calculation for allnodes_domains is wrong.  We
should really be using cumulative power of the physical packages in that
group (similar to the calculation in node_domains)
Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1e9f28fa
...@@ -5621,6 +5621,32 @@ static int cpu_to_allnodes_group(int cpu) ...@@ -5621,6 +5621,32 @@ static int cpu_to_allnodes_group(int cpu)
{ {
return cpu_to_node(cpu); return cpu_to_node(cpu);
} }
static void init_numa_sched_groups_power(struct sched_group *group_head)
{
struct sched_group *sg = group_head;
int j;
if (!sg)
return;
next_sg:
for_each_cpu_mask(j, sg->cpumask) {
struct sched_domain *sd;
sd = &per_cpu(phys_domains, j);
if (j != first_cpu(sd->groups->cpumask)) {
/*
* Only add "power" once for each
* physical package.
*/
continue;
}
sg->cpu_power += sd->groups->cpu_power;
}
sg = sg->next;
if (sg != group_head)
goto next_sg;
}
#endif #endif
/* /*
...@@ -5866,43 +5892,13 @@ void build_sched_domains(const cpumask_t *cpu_map) ...@@ -5866,43 +5892,13 @@ void build_sched_domains(const cpumask_t *cpu_map)
(cpus_weight(sd->groups->cpumask)-1) / 10; (cpus_weight(sd->groups->cpumask)-1) / 10;
sd->groups->cpu_power = power; sd->groups->cpu_power = power;
#endif #endif
#ifdef CONFIG_NUMA
sd = &per_cpu(allnodes_domains, i);
if (sd->groups) {
power = SCHED_LOAD_SCALE + SCHED_LOAD_SCALE *
(cpus_weight(sd->groups->cpumask)-1) / 10;
sd->groups->cpu_power = power;
}
#endif
} }
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
for (i = 0; i < MAX_NUMNODES; i++) { for (i = 0; i < MAX_NUMNODES; i++)
struct sched_group *sg = sched_group_nodes[i]; init_numa_sched_groups_power(sched_group_nodes[i]);
int j;
if (sg == NULL)
continue;
next_sg:
for_each_cpu_mask(j, sg->cpumask) {
struct sched_domain *sd;
sd = &per_cpu(phys_domains, j); init_numa_sched_groups_power(sched_group_allnodes);
if (j != first_cpu(sd->groups->cpumask)) {
/*
* Only add "power" once for each
* physical package.
*/
continue;
}
sg->cpu_power += sd->groups->cpu_power;
}
sg = sg->next;
if (sg != sched_group_nodes[i])
goto next_sg;
}
#endif #endif
/* Attach the domains */ /* Attach the domains */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册