Skip to content

Commit 8392853

Browse files
Frederic WeisbeckerIngo Molnar
authored andcommitted
rackmeter: Use vtime aware kcpustat accessor
Now that we have a vtime safe kcpustat accessor, use it to fetch CPUTIME_NICE and fix frozen kcpustat values on nohz_full CPUs. Reported-by: Yauheni Kaliuta <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Wanpeng Li <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 8688f2f commit 8392853

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/macintosh/rack-meter.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,14 @@ static int rackmeter_ignore_nice;
8181
*/
8282
static inline u64 get_cpu_idle_time(unsigned int cpu)
8383
{
84+
struct kernel_cpustat *kcpustat = &kcpustat_cpu(cpu);
8485
u64 retval;
8586

86-
retval = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE] +
87-
kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT];
87+
retval = kcpustat->cpustat[CPUTIME_IDLE] +
88+
kcpustat->cpustat[CPUTIME_IOWAIT];
8889

8990
if (rackmeter_ignore_nice)
90-
retval += kcpustat_cpu(cpu).cpustat[CPUTIME_NICE];
91+
retval += kcpustat_field(kcpustat, CPUTIME_NICE, cpu);
9192

9293
return retval;
9394
}

0 commit comments

Comments
 (0)