diff options
author | Michal Hocko <mhocko@suse.cz> | 2011-08-24 03:37:48 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-09-08 05:10:55 -0400 |
commit | 6beea0cda8ce71c01354e688e5735c47e331e84f (patch) | |
tree | 7556787053d608134184d98413cce744d54507fc /drivers/cpufreq/cpufreq_ondemand.c | |
parent | ef0e0f5ed9bde6d1e3376169785a463ad2160e6d (diff) |
nohz: Fix update_ts_time_stat idle accounting
update_ts_time_stat currently updates idle time even if we are in
iowait loop at the moment. The only real users of the idle counter
(via get_cpu_idle_time_us) are CPU governors and they expect to get
cumulative time for both idle and iowait times.
The value (idle_sleeptime) is also printed to userspace by print_cpu
but it prints both idle and iowait times so the idle part is misleading.
Let's clean this up and fix update_ts_time_stat to account both counters
properly and update consumers of idle to consider iowait time as well.
If we do this we might use get_cpu_{idle,iowait}_time_us from other
contexts as well and we will get expected values.
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Cc: Dave Jones <davej@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Link: http://lkml.kernel.org/r/e9c909c221a8da402c4da07e4cd968c3218f8eb1.1314172057.git.mhocko@suse.cz
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 891360edecdd..07756bddedef 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -144,10 +144,12 @@ static inline cputime64_t get_cpu_idle_time_jiffy(unsigned int cpu, | |||
144 | 144 | ||
145 | static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) | 145 | static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) |
146 | { | 146 | { |
147 | u64 idle_time = get_cpu_idle_time_us(cpu, wall); | 147 | u64 idle_time = get_cpu_idle_time_us(cpu, NULL); |
148 | 148 | ||
149 | if (idle_time == -1ULL) | 149 | if (idle_time == -1ULL) |
150 | return get_cpu_idle_time_jiffy(cpu, wall); | 150 | return get_cpu_idle_time_jiffy(cpu, wall); |
151 | else | ||
152 | idle_time += get_cpu_iowait_time_us(cpu, wall); | ||
151 | 153 | ||
152 | return idle_time; | 154 | return idle_time; |
153 | } | 155 | } |