public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Yu Liao <liaoyu15@huawei.com>,
	fweisbec@gmail.com, mingo@kernel.org, liwei391@huawei.com,
	adobriyan@gmail.com, mirsad.todorovac@alu.unizg.hr,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] tick/nohz: fix data races in get_cpu_idle_time_us()
Date: Wed, 1 Feb 2023 10:03:28 +0100	[thread overview]
Message-ID: <Y9oq4OSJXJvr56Oj@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <Y9mEB7LMaZ0dMQS/@lothringen>

On Tue, Jan 31, 2023 at 10:11:35PM +0100, Frederic Weisbecker wrote:
> On Tue, Jan 31, 2023 at 08:57:59PM +0100, Peter Zijlstra wrote:
> > On Tue, Jan 31, 2023 at 03:44:00PM +0100, Thomas Gleixner wrote:
> > 
> > > P.S.: I hate the spinlock in the idle code path, but I don't have a
> > >       better idea.
> > 
> > seqcount? It would avoid the obvious interleave and put most of the onus
> > on the reader (which never happens anyway).
> 
> Yep, and do the update locally only on idle exit. But note that neither
> seqcount nor spinlock will fix the nr_iowait_cpu() based thing. This counter
> can be decremented remotely even during the idle period so the reader
> can see an iowait period that may eventually be accounted as !iowait,
> or the reverse. Breaking the monotonicity and even coherency.
> 
> That stuff is broken by design and this is the reason why it got never
> really fixed. The seqcount/spinlock would make it just a bit less worse.

Yeah, iowait is a random number generator, -EWONTFIX on that.

  reply	other threads:[~2023-02-01  9:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-28  2:00 [PATCH RFC] tick/nohz: fix data races in get_cpu_idle_time_us() Yu Liao
2023-01-31 14:44 ` Thomas Gleixner
2023-01-31 18:35   ` Alexey Dobriyan
2023-01-31 19:59     ` Peter Zijlstra
2023-01-31 19:57   ` Peter Zijlstra
2023-01-31 21:11     ` Frederic Weisbecker
2023-02-01  9:03       ` Peter Zijlstra [this message]
2023-02-08 15:19   ` [PATCH] timers/nohz: Restructure and reshuffle struct tick_sched Frederic Weisbecker
     [not found] ` <20230201045302.316-1-hdanton@sina.com>
2023-02-01 12:02   ` [PATCH RFC] tick/nohz: fix data races in get_cpu_idle_time_us() Frederic Weisbecker
     [not found]   ` <20230201140117.539-1-hdanton@sina.com>
2023-02-01 14:28     ` Frederic Weisbecker
2023-02-06  7:03 ` kernel test robot
2023-02-07  5:25 ` Mirsad Goran Todorovac
2023-02-07  8:03   ` Mirsad Goran Todorovac

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=Y9oq4OSJXJvr56Oj@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=adobriyan@gmail.com \
    --cc=frederic@kernel.org \
    --cc=fweisbec@gmail.com \
    --cc=liaoyu15@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liwei391@huawei.com \
    --cc=mingo@kernel.org \
    --cc=mirsad.todorovac@alu.unizg.hr \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox