diff options
-rw-r--r-- | drivers/cpufreq/cpufreq_conservative.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 4 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 8 |
3 files changed, 10 insertions, 6 deletions
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 33b56e5c5c14..c97b468ee9f7 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c | |||
@@ -120,10 +120,12 @@ static inline cputime64_t get_cpu_idle_time_jiffy(unsigned int cpu, | |||
120 | 120 | ||
121 | static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) | 121 | static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) |
122 | { | 122 | { |
123 | u64 idle_time = get_cpu_idle_time_us(cpu, wall); | 123 | u64 idle_time = get_cpu_idle_time_us(cpu, NULL); |
124 | 124 | ||
125 | if (idle_time == -1ULL) | 125 | if (idle_time == -1ULL) |
126 | return get_cpu_idle_time_jiffy(cpu, wall); | 126 | return get_cpu_idle_time_jiffy(cpu, wall); |
127 | else | ||
128 | idle_time += get_cpu_iowait_time_us(cpu, wall); | ||
127 | 129 | ||
128 | return idle_time; | 130 | return idle_time; |
129 | } | 131 | } |
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 | } |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index d5097c44b407..7ab44bca6546 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -159,9 +159,10 @@ update_ts_time_stats(int cpu, struct tick_sched *ts, ktime_t now, u64 *last_upda | |||
159 | 159 | ||
160 | if (ts->idle_active) { | 160 | if (ts->idle_active) { |
161 | delta = ktime_sub(now, ts->idle_entrytime); | 161 | delta = ktime_sub(now, ts->idle_entrytime); |
162 | ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); | ||
163 | if (nr_iowait_cpu(cpu) > 0) | 162 | if (nr_iowait_cpu(cpu) > 0) |
164 | ts->iowait_sleeptime = ktime_add(ts->iowait_sleeptime, delta); | 163 | ts->iowait_sleeptime = ktime_add(ts->iowait_sleeptime, delta); |
164 | else | ||
165 | ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); | ||
165 | ts->idle_entrytime = now; | 166 | ts->idle_entrytime = now; |
166 | } | 167 | } |
167 | 168 | ||
@@ -200,8 +201,7 @@ static ktime_t tick_nohz_start_idle(int cpu, struct tick_sched *ts) | |||
200 | * @last_update_time: variable to store update time in | 201 | * @last_update_time: variable to store update time in |
201 | * | 202 | * |
202 | * Return the cummulative idle time (since boot) for a given | 203 | * Return the cummulative idle time (since boot) for a given |
203 | * CPU, in microseconds. The idle time returned includes | 204 | * CPU, in microseconds. |
204 | * the iowait time (unlike what "top" and co report). | ||
205 | * | 205 | * |
206 | * This time is measured via accounting rather than sampling, | 206 | * This time is measured via accounting rather than sampling, |
207 | * and is as accurate as ktime_get() is. | 207 | * and is as accurate as ktime_get() is. |
@@ -221,7 +221,7 @@ u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time) | |||
221 | } | 221 | } |
222 | EXPORT_SYMBOL_GPL(get_cpu_idle_time_us); | 222 | EXPORT_SYMBOL_GPL(get_cpu_idle_time_us); |
223 | 223 | ||
224 | /* | 224 | /** |
225 | * get_cpu_iowait_time_us - get the total iowait time of a cpu | 225 | * get_cpu_iowait_time_us - get the total iowait time of a cpu |
226 | * @cpu: CPU number to query | 226 | * @cpu: CPU number to query |
227 | * @last_update_time: variable to store update time in | 227 | * @last_update_time: variable to store update time in |