summaryrefslogtreecommitdiff
path: root/kernel/sched/sched.h
diff options
context:
space:
mode:
authorChris Redpath <chris.redpath@arm.com>2017-04-25 10:37:58 +0100
committerChris Redpath <chris.redpath@arm.com>2017-10-27 13:30:32 +0100
commitfac311be26e5af64612c386f5a041984fe7c59a2 (patch)
treef710754397aa5e087c2ea7ac29ae087b79426d02 /kernel/sched/sched.h
parentc8bc3e3a3ede641b48360ab0bd35eb316168008b (diff)
cpufreq/sched: Consider max cpu capacity when choosing frequencies
When using schedfreq on cpus with max capacity significantly smaller than 1024, the tick update uses non-normalised capacities - this leads to selecting an incorrect OPP as we were scaling the frequency as if the max capacity achievable was 1024 rather than the max for that particular cpu or group. This could result in a cpu being stuck at the lowest OPP and unable to generate enough utilisation to climb out if the max capacity is significantly smaller than 1024. Instead, normalize the capacity to be in the range 0-1024 in the tick so that when we later select a frequency, we get the correct one. Also comments updated to be clearer about what is needed. Change-Id: Id84391c7ac015311002ada21813a353ee13bee60 Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r--kernel/sched/sched.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 9f3d89faacdc..5256f05a26e8 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1621,6 +1621,10 @@ static inline bool sched_freq(void)
return static_key_false(&__sched_freq);
}
+/*
+ * sched_capacity_reqs expects capacity requests to be normalised.
+ * All capacities should sum to the range of 0-1024.
+ */
DECLARE_PER_CPU(struct sched_capacity_reqs, cpu_sched_capacity_reqs);
void update_cpu_capacity_request(int cpu, bool request);