From: Denys Vlasenko <dvlasenk@redhat.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>,
Fernando Luis Vazquez Cao <fernando_b1@lab.ntt.co.jp>,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Arjan van de Ven <arjan@linux.intel.com>,
Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH 4/4] nohz: Fix iowait overcounting if iowait task migrates
Date: Wed, 07 May 2014 15:38:15 +0200 [thread overview]
Message-ID: <536A3747.5040506@redhat.com> (raw)
In-Reply-To: <5367D30E.9020901@redhat.com>
On 05/05/2014 08:06 PM, Denys Vlasenko wrote:
> On 04/29/2014 04:47 PM, Frederic Weisbecker wrote:
>> On Thu, Apr 24, 2014 at 08:45:58PM +0200, Denys Vlasenko wrote:
>>> +void tick_nohz_iowait_to_idle(int cpu)
>>> +{
>>> + struct tick_sched *ts = tick_get_tick_sched(cpu);
>>> + ktime_t now = ktime_get();
>>> +
>>> + write_seqcount_begin(&ts->idle_sleeptime_seq);
>>> + ts->iowait_exittime = now;
>>> + write_seqcount_end(&ts->idle_sleeptime_seq);
>>
>> So now you have two concurrent updaters using the seqcount, which is
>> very dangerous as the counters aren't updated atomically.
>>
>> seqcount is only suitable when there is a single sequential updater.
>> Once you deal with concurrent updaters you need seqlock.
>>
>> And once you add seqlock in the hot scheduler path, you're hitting
>> a big scalability issue.
>
> What I need here is merely an atomic store.
> The complication is, of course, that, ktime_t is not atomic[64]_t.
>
> How do you think I can do an atomic store?
Ok, I think a have a version which uses atomic64_t
and is not looking ugly. Sending new patchset now...
next prev parent reply other threads:[~2014-05-07 13:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-24 18:45 [PATCH 1/4] nohz: Only update sleeptime stats locally Denys Vlasenko
2014-04-24 18:45 ` [PATCH 2/4] nohz: Synchronize sleep time stats with seqlock Denys Vlasenko
2014-04-24 18:45 ` [PATCH 3/4] nohz: Fix idle/iowait counts going backwards Denys Vlasenko
2014-04-24 18:45 ` [PATCH 4/4] nohz: Fix iowait overcounting if iowait task migrates Denys Vlasenko
2014-04-24 19:18 ` Peter Zijlstra
2014-04-25 18:56 ` Denys Vlasenko
2014-04-29 14:47 ` Frederic Weisbecker
2014-05-05 18:06 ` Denys Vlasenko
2014-05-07 13:38 ` Denys Vlasenko [this message]
2014-04-29 16:20 ` Frederic Weisbecker
2014-05-05 18:14 ` Denys Vlasenko
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=536A3747.5040506@redhat.com \
--to=dvlasenk@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=arjan@linux.intel.com \
--cc=fernando_b1@lab.ntt.co.jp \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=peterz@infradead.org \
--cc=seto.hidetoshi@jp.fujitsu.com \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.