From: Peter Zijlstra <peterz@infradead.org>
To: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] sched: Account per task_group nr_iowait
Date: Mon, 6 Nov 2017 17:25:34 +0100 [thread overview]
Message-ID: <20171106162534.GE3857@worktop> (raw)
In-Reply-To: <20171106162436.GL3165@worktop.lehotels.local>
On Mon, Nov 06, 2017 at 05:24:36PM +0100, Peter Zijlstra wrote:
> On Mon, Nov 06, 2017 at 07:12:58PM +0300, Kirill Tkhai wrote:
>
> > >> + atomic_inc(&tg->stat[rq->cpu].nr_iowait);
> > >
> > > You're joking right, more atomic ops on the fast paths..
> >
> > There should be a synchronization... It's modified under rq->lock everywhere, except try_to_wakeup().
> > Would it be better to use one more rq->lock at try_to_wakeup() instead of atomic?
>
> No, of course not. We spend a lot of time getting of that rq->lock
^ rid
> there.
>
> The better option is to not care about iowait, since its a complete
> garbage number to begin with -- read that commit I pointed you to.
>
> But if you do manage to convince me iowait is a sane thing to export
> (and its not); then you should not use atomics -- nor is there any need
> to. Since all you want to export is \Sum nr_iowait, you can inc/dec to
> pure cpu local variables and the sum will make it all work.
>
> The extant iowait crap cannot do this because it thinks per-cpu IO-wait
> is a thing -- its not, its a random number at best, but its ABI so we
> can't fix :-(
next prev parent reply other threads:[~2017-11-06 16:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-06 14:40 [PATCH 0/4] Show cpu cgroup's nr_running and nr_iowait in cpu.stat file Kirill Tkhai
2017-11-06 14:40 ` [PATCH 1/4] sched: Move manipulations with nr_iowait counter to separate functions Kirill Tkhai
2017-11-06 14:40 ` [PATCH 2/4] sched: Account per task_group nr_iowait Kirill Tkhai
2017-11-06 16:06 ` Peter Zijlstra
2017-11-06 16:12 ` Kirill Tkhai
2017-11-06 16:24 ` Peter Zijlstra
2017-11-06 16:25 ` Peter Zijlstra [this message]
2017-11-06 14:40 ` [PATCH 3/4] sched: Export per task_cgroup nr_iowait to userspace Kirill Tkhai
2017-11-06 14:40 ` [PATCH 4/4] sched: Export per task_cgroup nr_running " Kirill Tkhai
2017-11-06 16:04 ` [PATCH 0/4] Show cpu cgroup's nr_running and nr_iowait in cpu.stat file Peter Zijlstra
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=20171106162534.GE3857@worktop \
--to=peterz@infradead.org \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.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