proc/stat: Fix wrong guest nice cpustat value
PATCH 1/1 proc/stat: Fix wrong guest nice cpustat value
From: Flavio Leitner <[email protected]>
The value being used for guest_nice should be CPUTIME_GUEST_NICE and not CPUTIME_USER.
Fixes 26dae145a76c ("procfs: Use all-in-one vtime aware kcpustat accessor")
Signed-off-by Flavio Leitner <[email protected]>
Signed-off-by Frederic Weisbecker <[email protected]>
--- fs/proc/stat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/proc/stat.c +2 -2
@@ -134,7 +134,7 @@ static int show_stat(struct seq_file *p, void *v) softirq += cpustat[CPUTIME_SOFTIRQ ]; steal += cpustat[CPUTIME_STEAL ]; guest += cpustat[CPUTIME_GUEST ]; - guest_nice += cpustat[CPUTIME_USER ]; + guest_nice += cpustat[CPUTIME_GUEST_NICE ]; sum +=kstat_cpu_irqs_sum (i); sum +=arch_irq_stat_cpu (i);
@@ -175,7 +175,7 @@ static int show_stat(struct seq_file *p, void *v) softirq = cpustat[CPUTIME_SOFTIRQ ]; steal = cpustat[CPUTIME_STEAL ]; guest = cpustat[CPUTIME_GUEST ]; - guest_nice = cpustat[CPUTIME_USER ]; + guest_nice = cpustat[CPUTIME_GUEST_NICE ];seq_printf (p,"cpu%d" , i);seq_put_decimal_ull (p," " ,nsec_to_clock_t (user));seq_put_decimal_ull (p," " ,nsec_to_clock_t (nice));
Signature · 1 line
2.23.0
[tip: sched/urgent] sched/cputime, proc/stat: Fix incorrect guest nice cpustat value
The following commit has been merged into the sched/urgent branch of tip:
The following commit has been merged into the sched/urgent branch of tip:
Commit-ID: 346da4d2c7ea39de65487b249aaa4733317a40ec Gitweb: https://git.kernel.org/tip/346da4d2c7ea39de65487b249aaa4733317a40ec Author: Flavio Leitner <[email protected]> AuthorDate: Thu, 05 Dec 2019 03:03:44 +01:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Wed, 11 Dec 2019 07:09:58 +01:00
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 26dae145a76c ("procfs: Use all-in-one vtime aware kcpustat accessor")
Signed-off-by Flavio Leitner <[email protected]>
Signed-off-by Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- fs/proc/stat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/proc/stat.c +2 -2
@@ -134,7 +134,7 @@ static int show_stat(struct seq_file *p, void *v) softirq += cpustat[CPUTIME_SOFTIRQ ]; steal += cpustat[CPUTIME_STEAL ]; guest += cpustat[CPUTIME_GUEST ]; - guest_nice += cpustat[CPUTIME_USER ]; + guest_nice += cpustat[CPUTIME_GUEST_NICE ]; sum +=kstat_cpu_irqs_sum (i); sum +=arch_irq_stat_cpu (i);
@@ -175,7 +175,7 @@ static int show_stat(struct seq_file *p, void *v) softirq = cpustat[CPUTIME_SOFTIRQ ]; steal = cpustat[CPUTIME_STEAL ]; guest = cpustat[CPUTIME_GUEST ]; - guest_nice = cpustat[CPUTIME_USER ]; + guest_nice = cpustat[CPUTIME_GUEST_NICE ];seq_printf (p,"cpu%d" , i);seq_put_decimal_ull (p," " ,nsec_to_clock_t (user));seq_put_decimal_ull (p," " ,nsec_to_clock_t (nice));