int idling;
u64 target_set_time;
u64 target_set_time_in_idle;
+ u64 target_validate_time;
+ u64 target_validate_time_in_idle;
struct cpufreq_policy *policy;
struct cpufreq_frequency_table *freq_table;
unsigned int target_freq;
/*
* Do not scale down unless we have been at this frequency for the
- * minimum sample time.
+ * minimum sample time since last validated.
*/
if (new_freq < pcpu->target_freq) {
- if (pcpu->timer_run_time - pcpu->target_set_time
+ if (pcpu->timer_run_time - pcpu->target_validate_time
< min_sample_time) {
trace_cpufreq_interactive_notyet(data, cpu_load,
pcpu->target_freq, new_freq);
}
}
- pcpu->target_set_time_in_idle = now_idle;
- pcpu->target_set_time = pcpu->timer_run_time;
+ pcpu->target_validate_time_in_idle = now_idle;
+ pcpu->target_validate_time = pcpu->timer_run_time;
if (pcpu->target_freq == new_freq) {
trace_cpufreq_interactive_already(data, cpu_load,
trace_cpufreq_interactive_target(data, cpu_load, pcpu->target_freq,
new_freq);
+ pcpu->target_set_time_in_idle = now_idle;
+ pcpu->target_set_time = pcpu->timer_run_time;
if (new_freq < pcpu->target_freq) {
pcpu->target_freq = new_freq;
pcpu->target_set_time_in_idle =
get_cpu_idle_time_us(j,
&pcpu->target_set_time);
+ pcpu->target_validate_time =
+ pcpu->target_set_time;
+ pcpu->target_validate_time_in_idle =
+ pcpu->target_set_time_in_idle;
pcpu->governor_enabled = 1;
smp_wmb();
}