mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-06 11:25:05 +07:00
sched/fair: Fix group power_orig computation
When looking at the code I noticed we don't actually compute sgp->power_orig correctly for groups, fix that. Currently the only consumer of that value is fix_small_capacity() which is only used on POWER7+ and that code excludes this case by being limited to SD_SHARE_CPUPOWER which is only ever set on the SMT domain which must be the lowest domain and this has singleton groups. So nothing should be affected by this change. Cc: Michael Neuling <mikey@neuling.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/n/tip-db2pe0vxwunv37plc7onnugj@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
b72ff13ce6
commit
863bffc808
@ -4450,7 +4450,7 @@ void update_group_power(struct sched_domain *sd, int cpu)
|
|||||||
{
|
{
|
||||||
struct sched_domain *child = sd->child;
|
struct sched_domain *child = sd->child;
|
||||||
struct sched_group *group, *sdg = sd->groups;
|
struct sched_group *group, *sdg = sd->groups;
|
||||||
unsigned long power;
|
unsigned long power, power_orig;
|
||||||
unsigned long interval;
|
unsigned long interval;
|
||||||
|
|
||||||
interval = msecs_to_jiffies(sd->balance_interval);
|
interval = msecs_to_jiffies(sd->balance_interval);
|
||||||
@ -4462,7 +4462,7 @@ void update_group_power(struct sched_domain *sd, int cpu)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
power = 0;
|
power_orig = power = 0;
|
||||||
|
|
||||||
if (child->flags & SD_OVERLAP) {
|
if (child->flags & SD_OVERLAP) {
|
||||||
/*
|
/*
|
||||||
@ -4470,8 +4470,12 @@ void update_group_power(struct sched_domain *sd, int cpu)
|
|||||||
* span the current group.
|
* span the current group.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for_each_cpu(cpu, sched_group_cpus(sdg))
|
for_each_cpu(cpu, sched_group_cpus(sdg)) {
|
||||||
power += power_of(cpu);
|
struct sched_group *sg = cpu_rq(cpu)->sd->groups;
|
||||||
|
|
||||||
|
power_orig += sg->sgp->power_orig;
|
||||||
|
power += sg->sgp->power;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* !SD_OVERLAP domains can assume that child groups
|
* !SD_OVERLAP domains can assume that child groups
|
||||||
@ -4480,12 +4484,14 @@ void update_group_power(struct sched_domain *sd, int cpu)
|
|||||||
|
|
||||||
group = child->groups;
|
group = child->groups;
|
||||||
do {
|
do {
|
||||||
|
power_orig += group->sgp->power_orig;
|
||||||
power += group->sgp->power;
|
power += group->sgp->power;
|
||||||
group = group->next;
|
group = group->next;
|
||||||
} while (group != child->groups);
|
} while (group != child->groups);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdg->sgp->power_orig = sdg->sgp->power = power;
|
sdg->sgp->power_orig = power_orig;
|
||||||
|
sdg->sgp->power = power;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user