diff options
author | Glauber Costa <glommer@parallels.com> | 2011-11-28 11:45:17 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-12-06 03:06:38 -0500 |
commit | 3292beb340c76884427faa1f5d6085719477d889 (patch) | |
tree | cb7e431b2a15fa66ef5278d485131bac7a125fbd /drivers/macintosh/rack-meter.c | |
parent | 786d6dc7aeb2bfbfe417507b7beb83919f319db3 (diff) |
sched/accounting: Change cpustat fields to an array
This patch changes fields in cpustat from a structure, to an
u64 array. Math gets easier, and the code is more flexible.
Signed-off-by: Glauber Costa <glommer@parallels.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Tuner <pjt@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1322498719-2255-2-git-send-email-glommer@parallels.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/macintosh/rack-meter.c')
-rw-r--r-- | drivers/macintosh/rack-meter.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 2637c139777b..66d7f1c7baa1 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 | } |