sched/cpufreq: make schedutil use WALT signal
authorJuri Lelli <juri.lelli@arm.com>
Wed, 14 Dec 2016 16:10:10 +0000 (16:10 +0000)
committerAmit Pundir <amit.pundir@linaro.org>
Wed, 21 Jun 2017 11:07:20 +0000 (16:37 +0530)
If WALT is available and enabled, make schedutil governor use its
utilization signal.

Change-Id: I92bc37989447a76616e9bcc4e9e8616774fb9925
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
[we need to use boosted_cpu_util for schedutil, so make it
 not static]
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
kernel/sched/cpufreq_schedutil.c
kernel/sched/fair.c

index 033da8f815da0f6b4ea9c2c655893be1efccca24..e9a9ee98daf700e6ec5a3e4af3d0e50b890eb9cb 100644 (file)
 #include <trace/events/power.h>
 
 #include "sched.h"
+#include "tune.h"
+
+#ifdef CONFIG_SCHED_WALT
+unsigned long boosted_cpu_util(int cpu);
+#endif
 
 /* Stub out fast switch routines present on mainline to reduce the backport
  * overhead. */
@@ -173,6 +178,10 @@ static void sugov_get_util(unsigned long *util, unsigned long *max, u64 time)
        rt = (rt * max_cap) >> SCHED_CAPACITY_SHIFT;
 
        *util = min(rq->cfs.avg.util_avg + rt, max_cap);
+#ifdef CONFIG_SCHED_WALT
+       if (!walt_disabled && sysctl_sched_use_walt_cpu_util)
+               *util = boosted_cpu_util(cpu);
+#endif
        *max = max_cap;
 }
 
index baba2d34c34e1d4dc860e16dc4c462d4b9714d83..abe49df1e6f00e66aaff4f40eb05d3bfd2e9e0dc 100644 (file)
@@ -4258,7 +4258,7 @@ static inline void hrtick_update(struct rq *rq)
 
 #ifdef CONFIG_SMP
 static bool cpu_overutilized(int cpu);
-static inline unsigned long boosted_cpu_util(int cpu);
+unsigned long boosted_cpu_util(int cpu);
 #else
 #define boosted_cpu_util(cpu) cpu_util(cpu)
 #endif
@@ -5478,7 +5478,7 @@ schedtune_task_margin(struct task_struct *task)
 
 #endif /* CONFIG_SCHED_TUNE */
 
-static inline unsigned long
+unsigned long
 boosted_cpu_util(int cpu)
 {
        unsigned long util = cpu_util(cpu);