diff options
author | Chris Redpath <chris.redpath@arm.com> | 2017-06-20 12:12:49 +0100 |
---|---|---|
committer | Chris Redpath <chris.redpath@arm.com> | 2017-10-23 12:30:46 +0100 |
commit | d34d2c97ae56961ca73fc8704aec2304bb820668 (patch) | |
tree | d543bd9757ca7f996e57803ac9a0f47a1f9e3813 /kernel | |
parent | 89074de67a6d5c8b99dc13d4fffca449a89938f8 (diff) |
cpufreq/sched: Use cpu max freq rather than policy max
When we convert capacity into frequency, we used policy->max to get
the max freq of the cpu. Since this can be changed by userspace policy
or thermal events, we are potentially asking for a lower frequency
than the utilization demands.
Change over to using cpuinfo.max which is the max freq supported by
that cpu rather than the currently-chosen max. Frequency granted still
honours the max policy.
Tested by setting a userspace policy and observing the relevant vars
in a trace. In this instance, we ask for around 1ghz instead of 620MHz.
freq_new=1013512
unfixed_freq_new=624487
capacity=546
cpuinfo_max=1900800
policy_max=1171200
Change-Id: I8c5694db42243c6fb78bb9be9046b06ac81295e7
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/cpufreq_sched.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c index 6ffb23adbcef..ec0aed7a8f96 100644 --- a/kernel/sched/cpufreq_sched.c +++ b/kernel/sched/cpufreq_sched.c @@ -202,7 +202,7 @@ static void update_fdomain_capacity_request(int cpu) } /* Convert the new maximum capacity request into a cpu frequency */ - freq_new = capacity * policy->max >> SCHED_CAPACITY_SHIFT; + freq_new = capacity * policy->cpuinfo.max_freq >> SCHED_CAPACITY_SHIFT; if (cpufreq_frequency_table_target(policy, policy->freq_table, freq_new, CPUFREQ_RELATION_L, &index_new)) |