From: rahul.khandelwal Date: Fri, 17 Apr 2015 06:15:23 +0000 (+0530) Subject: subsystem: CPU FREQUENCY DRIVERS- Set cpu_load calculation on current frequency X-Git-Tag: firefly_0821_release~2958^2~238 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4808d2835106dac954682fe427387b115834b348;p=firefly-linux-kernel-4.4.55.git subsystem: CPU FREQUENCY DRIVERS- Set cpu_load calculation on current frequency In timer, cpu_load is calcuated on target_freq. cpu_load = loadadjfreq / pcpu->target_freq; But cpu is actually running on current freq i.e. pcpu->policy->cur. So cpu_load should be calculated on current frequency. cpu_load = loadadjfreq / pcpu->policy->cur; Change-Id: I89db6b68e9f82aa52077f6bf7d819dab74265790 Signed-off-by: rahul.khandelwal --- diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index 9259d4829765..0be66df4a6e6 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -387,7 +387,7 @@ static void cpufreq_interactive_timer(unsigned long data) spin_lock_irqsave(&pcpu->target_freq_lock, flags); do_div(cputime_speedadj, delta_time); loadadjfreq = (unsigned int)cputime_speedadj * 100; - cpu_load = loadadjfreq / pcpu->target_freq; + cpu_load = loadadjfreq / pcpu->policy->cur; tunables->boosted = tunables->boost_val || now < tunables->boostpulse_endtime; if (cpu_load >= tunables->go_hispeed_load || tunables->boosted) {