From: Tejun Heo <tj@kernel.org>
To: Peter Zijlstra <peterz@infradead.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 10:27:51 -0400 [thread overview]
Message-ID: <20200924142751.GF4268@mtj.duckdns.org> (raw)
In-Reply-To: <20200924115042.GG2628@hirez.programming.kicks-ass.net>
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?
Thanks.
--
tejun
next prev parent reply other threads:[~2020-09-24 14:27 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 [this message]
2020-09-24 14:50 ` Peter Zijlstra
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=20200924142751.GF4268@mtj.duckdns.org \
--to=tj@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
/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