mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
sched: Add smt_gain
The idea is that multi-threading a core yields more work capacity than a single thread, provide a way to express a static gain for threads. Signed-off-by: Peter Zijlstra <[email protected]> Tested-by: Andreas Herrmann <[email protected]> Acked-by: Andreas Herrmann <[email protected]> Acked-by: Gautham R Shenoy <[email protected]> Cc: Balbir Singh <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
cc9fba7d76
commit
a52bfd7358
3 changed files with 9 additions and 1 deletions
|
|
@ -8523,9 +8523,15 @@ static void init_sched_groups_power(int cpu, struct sched_domain *sd)
|
|||
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)
|
||||
if ((sd->flags & SD_SHARE_CPUPOWER) && weight > 1) {
|
||||
power *= sd->smt_gain;
|
||||
power /= weight;
|
||||
power >>= SCHED_LOAD_SHIFT;
|
||||
}
|
||||
sg_inc_cpu_power(sd->groups, power);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue