[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190817220627.GI28441@linux.ibm.com>
Date: Sat, 17 Aug 2019 15:06:27 -0700
From: "Paul E. McKenney" <paulmck@...ux.ibm.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Joel Fernandes, Google" <joel@...lfernandes.org>,
Alan Stern <stern@...land.harvard.edu>,
Valentin Schneider <valentin.schneider@....com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Boqun Feng <boqun.feng@...il.com>,
Will Deacon <will.deacon@....com>,
David Howells <dhowells@...hat.com>
Subject: Re: [PATCH 1/1] Fix: trace sched switch start/stop racy updates
On Sat, Aug 17, 2019 at 12:40:40PM -0400, Steven Rostedt wrote:
> On Sat, 17 Aug 2019 11:55:17 -0400 (EDT)
> Mathieu Desnoyers <mathieu.desnoyers@...icios.com> wrote:
>
> > ----- On Aug 17, 2019, at 11:26 AM, rostedt rostedt@...dmis.org wrote:
> >
> > > On Sat, 17 Aug 2019 10:40:31 -0400 (EDT)
> > > Mathieu Desnoyers <mathieu.desnoyers@...icios.com> wrote:
> > >
> > >> > I'm now even more against adding the READ_ONCE() or WRITE_ONCE().
> > >>
> > >> I'm not convinced by your arguments.
> > >
> > > Prove to me that there's an issue here beyond theoretical analysis,
> > > then I'll consider that patch.
> > >
> > > Show me a compiler used to compile the kernel that zeros out the
> > > increment. Show me were the race actually occurs.
> > >
> > > I think the READ/WRITE_ONCE() is more confusing than helpful. And
> > > unneeded churn to the code. And really not needed for something that's
> > > not critical to execution.
> >
> > I'll have to let the authors of the LWN article speak up on this, because
> > I have limited time to replicate this investigation myself.
>
> I'll let Paul McKenney convince me then, if he has any spare cycles ;-)
You guys do manage to time these things sometimes. ;-)
> The one instance in that article is from a 2013 bug, which talks about
> storing a 64 bit value on a 32 bit machine. But the ref count is an int
> (32 bit), and I highly doubt any compiler will split it into 16 bit
> stores for a simple increment. And I don't believe Linux even supports
> any architecture that requires 16 bit stores anymore.
For a machine-sized and aligned increment, it is indeed hard to imagine,
even for me. I would be more worried about stores of constants with
lots of zero bits between non-zero bits on systems with small-sized
store-immediate instructions.
Thanx, Paul
Powered by blists - more mailing lists