diff options
author | Steve Muckle <steve.muckle@linaro.org> | 2015-11-05 13:55:56 -0800 |
---|---|---|
committer | Steve Muckle <steve.muckle@linaro.org> | 2015-11-05 19:08:12 -0800 |
commit | 2a6525c95744bc9cbe800c8073adae553fe37e76 (patch) | |
tree | 77fbe6a6050ae7f9a4f9d1d7feaae91f186bf7e9 | |
parent | 8194d9df368488d6f953df9ea8f63834f9b9ad1a (diff) |
sched/cpufreq_sched: avoid redundant attempts to change the frequency
Narrow down the frequency requests to the actual OPPs supported by
the frequency domain. This will prevent redundant frequency change
attempts which have the negative side effect of throttling
non-redundant frequency change operations.
Signed-off-by: Steve Muckle <steve.muckle@linaro.org>
-rw-r--r-- | kernel/sched/cpufreq_sched.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c index 4783649f1bdc..f1351ce6c295 100644 --- a/kernel/sched/cpufreq_sched.c +++ b/kernel/sched/cpufreq_sched.c @@ -168,7 +168,7 @@ static void cpufreq_sched_irq_work(struct irq_work *irq_work) */ static void cpufreq_sched_set_cap(int cpu, unsigned long capacity) { - unsigned int freq_new, cpu_tmp; + unsigned int freq_new, index_new, cpu_tmp; struct cpufreq_policy *policy; struct gov_data *gd; unsigned long capacity_max = 0; @@ -214,9 +214,14 @@ static void cpufreq_sched_set_cap(int cpu, unsigned long capacity) /* Convert the new maximum capacity request into a cpu frequency */ freq_new = capacity * policy->max >> SCHED_CAPACITY_SHIFT; + if (cpufreq_frequency_table_target(policy, policy->freq_table, + freq_new, CPUFREQ_RELATION_L, + &index_new)) + goto out; + freq_new = policy->freq_table[index_new].frequency; /* No change in frequency? Bail and return current capacity. */ - if (freq_new == policy->cur) + if (freq_new == gd->requested_freq) goto out; /* store the new frequency and perform the transition */ |