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