aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2012-04-26 21:41:40 -0700
committerTodd Poynor <toddpoynor@google.com>2012-04-26 22:07:00 -0700
commitfd8bc3774515bc6d2af3dfe567f902098cb0dea8 (patch)
tree77f3cb6e258b0befc2700ad98bf4b14de9da15b5 /drivers/cpufreq
parent5d61d3a6e2103801565048202999423657b4430a (diff)
downloadkernel_samsung_tuna-fd8bc3774515bc6d2af3dfe567f902098cb0dea8.zip
kernel_samsung_tuna-fd8bc3774515bc6d2af3dfe567f902098cb0dea8.tar.gz
kernel_samsung_tuna-fd8bc3774515bc6d2af3dfe567f902098cb0dea8.tar.bz2
cpufreq: interactive: set floor for boosted speed
Allow speed to drop to flooor frequency but not below, don't pin to speed at last boost. Change-Id: I0147c2b7a2e61ba16820605af6baaf09570be787 Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq_interactive.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c
index 10a31db..9572736 100644
--- a/drivers/cpufreq/cpufreq_interactive.c
+++ b/drivers/cpufreq/cpufreq_interactive.c
@@ -45,10 +45,11 @@ struct cpufreq_interactive_cpuinfo {
int idling;
u64 target_set_time;
u64 target_set_time_in_idle;
- u64 target_validate_time;
struct cpufreq_policy *policy;
struct cpufreq_frequency_table *freq_table;
unsigned int target_freq;
+ unsigned int floor_freq;
+ u64 floor_validate_time;
int governor_enabled;
};
@@ -229,12 +230,12 @@ static void cpufreq_interactive_timer(unsigned long data)
new_freq = pcpu->freq_table[index].frequency;
/*
- * Do not scale down unless we have been at this frequency for the
- * minimum sample time since last validated.
+ * Do not scale below floor_freq unless we have been at or above the
+ * floor frequency for the minimum sample time since last validated.
*/
- if (new_freq < pcpu->target_freq) {
+ if (new_freq < pcpu->floor_freq) {
if (cputime64_sub(pcpu->timer_run_time,
- pcpu->target_validate_time)
+ pcpu->floor_validate_time)
< min_sample_time) {
trace_cpufreq_interactive_notyet(data, cpu_load,
pcpu->target_freq, new_freq);
@@ -242,7 +243,8 @@ static void cpufreq_interactive_timer(unsigned long data)
}
}
- pcpu->target_validate_time = pcpu->timer_run_time;
+ pcpu->floor_freq = new_freq;
+ pcpu->floor_validate_time = pcpu->timer_run_time;
if (pcpu->target_freq == new_freq) {
trace_cpufreq_interactive_already(data, cpu_load,
@@ -510,12 +512,12 @@ static void cpufreq_interactive_boost(void)
}
/*
- * Refresh time at which current (possibly being
- * boosted) speed last validated (reset timer for
- * allowing speed to drop).
+ * Set floor freq and (re)start timer for when last
+ * validated.
*/
- pcpu->target_validate_time = ktime_to_us(ktime_get());
+ pcpu->floor_freq = hispeed_freq;
+ pcpu->floor_validate_time = ktime_to_us(ktime_get());
}
spin_unlock_irqrestore(&up_cpumask_lock, flags);
@@ -813,7 +815,8 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
pcpu->target_set_time_in_idle =
get_cpu_idle_time_us(j,
&pcpu->target_set_time);
- pcpu->target_validate_time =
+ pcpu->floor_freq = pcpu->target_freq;
+ pcpu->floor_validate_time =
pcpu->target_set_time;
pcpu->governor_enabled = 1;
smp_wmb();