public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Flavio Leitner <fbl@sysclose.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] /proc/stat: fix wrong cpustat gnice value
Date: Thu, 5 Dec 2019 02:58:20 +0100	[thread overview]
Message-ID: <20191205015819.GA14589@lenoir> (raw)
In-Reply-To: <20191205003936.2635315-1-fbl@sysclose.org>

On Wed, Dec 04, 2019 at 09:39:36PM -0300, Flavio Leitner wrote:
> 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 <fbl@sysclose.org>

Good catch, thanks!

> ---
>  fs/proc/stat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/proc/stat.c b/fs/proc/stat.c
> index 37bdbec5b402..fd931d3e77be 100644
> --- a/fs/proc/stat.c
> +++ b/fs/proc/stat.c
> @@ -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));
> -- 
> 2.23.0
> 

      reply	other threads:[~2019-12-05  1:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05  0:39 [PATCH] /proc/stat: fix wrong cpustat gnice value Flavio Leitner
2019-12-05  1:58 ` Frederic Weisbecker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191205015819.GA14589@lenoir \
    --to=frederic@kernel.org \
    --cc=fbl@sysclose.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox