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>
This commit is contained in:

committed by
Ingo Molnar

parent
786d6dc7ae
commit
3292beb340
@@ -81,13 +81,13 @@ static int rackmeter_ignore_nice;
|
||||
*/
|
||||
static inline cputime64_t get_cpu_idle_time(unsigned int cpu)
|
||||
{
|
||||
cputime64_t retval;
|
||||
u64 retval;
|
||||
|
||||
retval = cputime64_add(kstat_cpu(cpu).cpustat.idle,
|
||||
kstat_cpu(cpu).cpustat.iowait);
|
||||
retval = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE] +
|
||||
kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT];
|
||||
|
||||
if (rackmeter_ignore_nice)
|
||||
retval = cputime64_add(retval, kstat_cpu(cpu).cpustat.nice);
|
||||
retval += kcpustat_cpu(cpu).cpustat[CPUTIME_NICE];
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
Reference in New Issue
Block a user