From d38aa541bacae8e176498f5e9919a0e233d503bb Mon Sep 17 00:00:00 2001 From: Vincent Guittot Date: Wed, 8 Apr 2015 14:34:25 +0200 Subject: sched: fix power/perf threshold --- arch/arm/kernel/topology.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index dd945f76fefd..efb4a196b47a 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -284,44 +284,33 @@ static inline int cpu_corepower_flags(void) * power threshold should be filled according to platform info that can come * from DT as an example. For now use default table */ -static int core_pack_threshold[8][2] = { +static int core_pack_threshold[2][2] = { /* pack, perf */ { 30, 100}, - { 30, 100}, - { 30, 100}, - { 30, 100}, - { 20, 100}, - { 20, 100}, - { 20, 100}, { 20, 100}, }; static int cpu_core_th(int cpu, int index) { - if (cpu < 8) - return (core_pack_threshold[cpu][index] * 1024) / 100 ; + if (arch_scale_cpu_capacity(cpu, NULL) < SCHED_CAPACITY_SCALE) + return (core_pack_threshold[1][index] * 1024) / 100; - return 0; + return (core_pack_threshold[0][index] * 1024) / 100; } -static int cluster_pack_threshold[8][2] = { +static int cluster_pack_threshold[2][2] = { /* pack, perf */ { 0, 100}, - { 0, 100}, - { 0, 100}, - { 0, 100}, - { 50, 70}, - { 50, 70}, - { 50, 70}, { 50, 70}, }; static int cpu_cluster_th(int cpu, int index) { - if (cpu < 8) - return (cluster_pack_threshold[cpu][index] * 1024) / 100; - return 0; + if (arch_scale_cpu_capacity(cpu, NULL) < SCHED_CAPACITY_SCALE) + return (cluster_pack_threshold[1][index] * 1024) / 100; + + return (cluster_pack_threshold[0][index] * 1024) / 100; } static struct sched_domain_topology_level arm_topology[] = { -- cgit v1.2.3