cpufreq: governors: Calculate iowait time only when necessary
authorStratos Karafotis <stratosk@semaphore.gr>
Thu, 28 Feb 2013 16:57:32 +0000 (16:57 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 31 Mar 2013 23:11:35 +0000 (01:11 +0200)
commit9366d84052e7c5b2eca804c08cfcd00b490f4de2
tree0f159a425d29f1c6be12dbf30f18a55b79ae72d2
parentfed573d5c91ab8f12801740cfac0567e33635b1e
cpufreq: governors: Calculate iowait time only when necessary

Currently we always calculate the CPU iowait time and add it to idle time.
If we are in ondemand and we use io_is_busy, we re-calculate iowait time
and we subtract it from idle time.

With this patch iowait time is calculated only when necessary avoiding
the double call to get_cpu_iowait_time_us. We use a parameter in
function get_cpu_idle_time to distinguish when the iowait time will be
added to idle time or not, without the need of keeping the prev_io_wait.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Acked-by: Viresh Kumar <viresh.kumar@linaro.,org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_governor.c
drivers/cpufreq/cpufreq_governor.h
drivers/cpufreq/cpufreq_ondemand.c