diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/rack-meter.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 2637c139777b..909908ebf164 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c | |||
@@ -83,11 +83,10 @@ static inline cputime64_t get_cpu_idle_time(unsigned int cpu) | |||
83 | { | 83 | { |
84 | cputime64_t retval; | 84 | cputime64_t retval; |
85 | 85 | ||
86 | retval = cputime64_add(kstat_cpu(cpu).cpustat.idle, | 86 | retval = kstat_cpu(cpu).cpustat.idle + kstat_cpu(cpu).cpustat.iowait; |
87 | kstat_cpu(cpu).cpustat.iowait); | ||
88 | 87 | ||
89 | if (rackmeter_ignore_nice) | 88 | if (rackmeter_ignore_nice) |
90 | retval = cputime64_add(retval, kstat_cpu(cpu).cpustat.nice); | 89 | retval += kstat_cpu(cpu).cpustat.nice; |
91 | 90 | ||
92 | return retval; | 91 | return retval; |
93 | } | 92 | } |
@@ -220,13 +219,11 @@ static void rackmeter_do_timer(struct work_struct *work) | |||
220 | int i, offset, load, cumm, pause; | 219 | int i, offset, load, cumm, pause; |
221 | 220 | ||
222 | cur_jiffies = jiffies64_to_cputime64(get_jiffies_64()); | 221 | cur_jiffies = jiffies64_to_cputime64(get_jiffies_64()); |
223 | total_ticks = (unsigned int)cputime64_sub(cur_jiffies, | 222 | total_ticks = (unsigned int) (cur_jiffies - rcpu->prev_wall); |
224 | rcpu->prev_wall); | ||
225 | rcpu->prev_wall = cur_jiffies; | 223 | rcpu->prev_wall = cur_jiffies; |
226 | 224 | ||
227 | total_idle_ticks = get_cpu_idle_time(cpu); | 225 | total_idle_ticks = get_cpu_idle_time(cpu); |
228 | idle_ticks = (unsigned int) cputime64_sub(total_idle_ticks, | 226 | idle_ticks = (unsigned int) (total_idle_ticks - rcpu->prev_idle); |
229 | rcpu->prev_idle); | ||
230 | rcpu->prev_idle = total_idle_ticks; | 227 | rcpu->prev_idle = total_idle_ticks; |
231 | 228 | ||
232 | /* We do a very dumb calculation to update the LEDs for now, | 229 | /* We do a very dumb calculation to update the LEDs for now, |