Skip to content

Commit 346da4d

Browse files
fleitneringomolnar
authored andcommitted
sched/cputime, proc/stat: Fix incorrect guest nice cpustat value
The value being used for guest_nice should be CPUTIME_GUEST_NICE and not CPUTIME_USER. Fixes: 26dae14 ("procfs: Use all-in-one vtime aware kcpustat accessor") Signed-off-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lkml.kernel.org/r/20191205020344.14940-1-frederic@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 6794862 commit 346da4d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/proc/stat.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static int show_stat(struct seq_file *p, void *v)
134134
softirq += cpustat[CPUTIME_SOFTIRQ];
135135
steal += cpustat[CPUTIME_STEAL];
136136
guest += cpustat[CPUTIME_GUEST];
137-
guest_nice += cpustat[CPUTIME_USER];
137+
guest_nice += cpustat[CPUTIME_GUEST_NICE];
138138
sum += kstat_cpu_irqs_sum(i);
139139
sum += arch_irq_stat_cpu(i);
140140

@@ -175,7 +175,7 @@ static int show_stat(struct seq_file *p, void *v)
175175
softirq = cpustat[CPUTIME_SOFTIRQ];
176176
steal = cpustat[CPUTIME_STEAL];
177177
guest = cpustat[CPUTIME_GUEST];
178-
guest_nice = cpustat[CPUTIME_USER];
178+
guest_nice = cpustat[CPUTIME_GUEST_NICE];
179179
seq_printf(p, "cpu%d", i);
180180
seq_put_decimal_ull(p, " ", nsec_to_clock_t(user));
181181
seq_put_decimal_ull(p, " ", nsec_to_clock_t(nice));

0 commit comments

Comments
 (0)