Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1140974ybl; Wed, 4 Dec 2019 17:59:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyHmmYE8ga63Z6kApRW42tXS0RGHDhBpRyeaUQZNDL4uf2haNPYnxAdHo44o0qBbYlV8IJk X-Received: by 2002:a9d:67c1:: with SMTP id c1mr4781507otn.20.1575511163445; Wed, 04 Dec 2019 17:59:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575511163; cv=none; d=google.com; s=arc-20160816; b=QNoIAwfrPG5rXGKq9Fkd5RrjKK5Rc51IUJ/aWHpMwPY4Q7KFlKcoDLvom6PGG0XoY3 sj5Jc3mPxUGUZnZheFacVunHdGCw7FAUcknpgp2wU6oNj8hppYQN6Iji6KUHmpBTiHMc vFkfU3Dd4d1f2x0WFIVL5GFzqugqumzEKVWtVUWGLI6PKVxUtUNHKc6rBMwYEdwBexv+ iJ3tBNyDy7TxQOPdNgKHxJt1VBEUgpi4W2IVFxOUOmxWWY+6T8T4jQhFT2PiKYVHcMTg e3t433YxIWEtOCLomobmCv1tXfmJIDS+B6MYeBGlOgWALrOCwkCuaD4BxipfDzJc159G Nwag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SlqwTWoMYvsoRXaT5h6SQRg+ynGY50GCTGO7kL3z7fA=; b=JH4PUQJnqYUgBgSsQuxzHzg8dI7ceAQ/rpqdvx3gPF+goJpuEbnV7gXB8bpwt1OM3J qZ37MTgjuDPALSz1DZntPpozuWF8scMlAzXLah4XDhxhJTgF2yRsoKquVUtJ506BggoS BLg9SiovuTKfa3YnYeZMdDibhDIfiMkOnwgsaiQT6MsMj+riPwhQWKAPEm/oHmXyL9jf Q5RlV/d/vPEA9oVkkYnju8OJtbpEi9WlQc/0ERKEQr58KQmHqc4ReF9Gf+321NEUPipr HwO6Cs5EEGqdhHgdEQD3cp0v+/We8Ss03/Jz9wx1GfPmNZ4Zopk4mzsHrdhybpyJsSqa uqJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EZ6UhdG6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e18si4302777otj.99.2019.12.04.17.59.10; Wed, 04 Dec 2019 17:59:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EZ6UhdG6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728674AbfLEB6Y (ORCPT + 99 others); Wed, 4 Dec 2019 20:58:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:39938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728121AbfLEB6X (ORCPT ); Wed, 4 Dec 2019 20:58:23 -0500 Received: from localhost (lfbn-ncy-1-150-155.w83-194.abo.wanadoo.fr [83.194.232.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A5F0D20659; Thu, 5 Dec 2019 01:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575511103; bh=m4om41388Poq2Glq55LX3ImwnlIpx7VvriV/Qajv7j8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EZ6UhdG6rz2h8Chr18lH9FwJ4igIQK2HG/CLxN61OxkQJMvGYycfi+x5LzvpjdlmT TRXBkKxntdXPqilcFqz+q+IFMqdjPqEXrgT8qGSijc8TimZ+b+ZAxCUY7FRjVpbXHR Q7OZzvSdz71ubK7V6q6HdhTo0mXYp9eXVpiGDVOo= Date: Thu, 5 Dec 2019 02:58:20 +0100 From: Frederic Weisbecker To: Flavio Leitner Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] /proc/stat: fix wrong cpustat gnice value Message-ID: <20191205015819.GA14589@lenoir> References: <20191205003936.2635315-1-fbl@sysclose.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191205003936.2635315-1-fbl@sysclose.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 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 >