linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org, Rik van Riel <riel@surriel.com>
Subject: Re: sched: rq->nr_iowait transiently going negative after the recent p->on_cpu optimization
Date: Thu, 24 Sep 2020 16:50:41 +0200	[thread overview]
Message-ID: <20200924145041.GP2628@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200924142751.GF4268@mtj.duckdns.org>

On Thu, Sep 24, 2020 at 10:27:51AM -0400, Tejun Heo wrote:
> Hello,
> 
> On Thu, Sep 24, 2020 at 01:50:42PM +0200, Peter Zijlstra wrote:
> > Hurmph.. I suppose you're right :/ And this is an actual problem?
> 
> Yeah, this got exposed to userspace as a full 64bit number which overflowed
> u32 conversion in the rust procfs library which aborted a program I was
> working on multiple times over several months.
> 
> On a more theoretical side, it might also surprise nr_iowait_cpu() users.
> However, a real problem that may be.
> 
> > I think the below should cure that, but blergh, not nice. If you could
> > confirm, I'll try and think of something nicer.
> 
> Rik suggested that it'd be sufficient to return 0 on underflow especially
> given that 0 is actually the right number to describe the state. So, maybe
> that can be a nicer code-wise?

I worry about things where one CPU has a positive value and one or more
(other) CPUs have a temporary negative value.



  reply	other threads:[~2020-09-24 14:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 17:27 sched: rq->nr_iowait transiently going negative after the recent p->on_cpu optimization Tejun Heo
2020-09-24 11:50 ` Peter Zijlstra
2020-09-24 14:27   ` Tejun Heo
2020-09-24 14:50     ` Peter Zijlstra [this message]
2020-09-24 14:57       ` Tejun Heo

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=20200924145041.GP2628@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@surriel.com \
    --cc=tj@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;
as well as URLs for NNTP newsgroup(s).