From 763fae9cfbb0650b488bdfacecd1f15c85b2f05f Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Mon, 6 Apr 2020 16:44:49 +0100 Subject: [PATCH] Revert "ANDROID: sched/fair: add arch scaling function for max frequency capping" This reverts commit 27ad2abc032bff8761bd0dd03f6e90d0bbd9e3e3. Upstream has an equivalent feature now, drop the Android-specific version. Bug: 120440300 Signed-off-by: Quentin Perret Change-Id: If5f89f10cbcd521b095bc2e12f2172349ea512be --- kernel/sched/fair.c | 12 ++++-------- kernel/sched/sched.h | 9 --------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c02f612056f7..fc0e2660b6b0 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8063,9 +8063,10 @@ static inline void init_sd_lb_stats(struct sd_lb_stats *sds) }; } -static unsigned long scale_rt_capacity(int cpu, unsigned long max) +static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu) { struct rq *rq = cpu_rq(cpu); + unsigned long max = arch_scale_cpu_capacity(cpu); unsigned long used, free; unsigned long irq; @@ -8094,15 +8095,10 @@ static unsigned long scale_rt_capacity(int cpu, unsigned long max) static void update_cpu_capacity(struct sched_domain *sd, int cpu) { - unsigned long capacity = arch_scale_cpu_capacity(cpu); + unsigned long capacity = scale_rt_capacity(sd, cpu); struct sched_group *sdg = sd->groups; - cpu_rq(cpu)->cpu_capacity_orig = capacity; - - capacity *= arch_scale_max_freq_capacity(sd, cpu); - capacity >>= SCHED_CAPACITY_SHIFT; - - capacity = scale_rt_capacity(cpu, capacity); + cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(cpu); if (!capacity) capacity = 1; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 11222675578a..98e2648c06e7 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2024,15 +2024,6 @@ unsigned long arch_scale_freq_capacity(int cpu) } #endif -#ifndef arch_scale_max_freq_capacity -struct sched_domain; -static __always_inline -unsigned long arch_scale_max_freq_capacity(struct sched_domain *sd, int cpu) -{ - return SCHED_CAPACITY_SCALE; -} -#endif - #ifdef CONFIG_SMP #ifdef CONFIG_PREEMPTION