Le 13 mai 2015 9:02 PM, "Jorge Ramirez-Ortiz" < jorge.ramirez-ortiz@linaro.org> a écrit :
On 05/13/2015 12:39 PM, Jon Medhurst (Tixy) wrote:
On Wed, 2015-05-13 at 11:06 -0400, Jorge Ramirez-Ortiz wrote:
From: Jorge Ramirez-Ortiz jro@xenomai.org
The current arm64 power scaling calculations deviate from the arm implementation causing scheduling problems on non bigLITTLE architectures (this could be due to baseline/merging issues).
I've never really looked at this code before but I did some comparisons of arm versus arm64 versions and LSK versus mainline and my observations are:
There is no arm64 implementation in mainline. (Is there a reason?)
The arm64 implementation in LSK closely resembles the arm mainline
version, except that mainline doesn't have the
if (min_capacity == max_capacity) return; else
That looks like an accidental side effect of commit 816a8de0017f ("ARM: topology: remove hwid/MPIDR dependency from cpu_capacity"). But it does meant that in mainline 'middle_capacity' is now set by parse_dt_cpu_power (to a useful value?) rather than being left as '1'.
- The arm version in LSK looks like the ARM64 version, in the sense
that 'middle_capacity' is not set, so is this something which needs addressing on arm as well?
I'd think so.
AFAICT ARM 32bits in lsk still uses the old algorithm with hwid which prevent the situation seen on arm64
Vincent
the patch below (scaling in the case where min_capacity == max_capacity)
is one
way of fixing it.
The proposed workaround uses the middle_capacity weighting factor to guarantee that all CPUs report the same power (1024) on non bigLITTLE
SoC.
Signed-off-by: Jorge Ramirez-Ortiz jro@xenomai.org
arch/arm64/kernel/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/topology.c
b/arch/arm64/kernel/topology.c
index db8bb29..65837c2 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -325,7 +325,7 @@ static void __init parse_dt_cpu_power(void) * constraint explained near table_efficiency[]. */ if (min_capacity == max_capacity)
return;
else if (4 * max_capacity < (3 * (max_capacity + min_capacity))) middle_capacity = (min_capacity + max_capacity) >> (SCHED_POWER_SHIFT+1);middle_capacity = max_capacity >> SCHED_POWER_SHIFT;