From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Waiman Long <waiman.long@hpe.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Peter Hurley <peter@hurleysoftware.com>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, Davidlohr Bueso <dave@stgolabs.net>,
Jason Low <jason.low2@hp.com>, Dave Chinner <david@fromorbit.com>,
Scott J Norton <scott.norton@hpe.com>,
Douglas Hatch <doug.hatch@hpe.com>,
kcc@google.com, dvyukov@google.com, dhowells@redhat.com
Subject: Re: [PATCH v2] locking/rwsem: Add reader-owned state to the owner field
Date: Wed, 18 May 2016 10:28:21 -0700 [thread overview]
Message-ID: <20160518172821.GV3528@linux.vnet.ibm.com> (raw)
In-Reply-To: <573C90B7.4010103@hpe.com>
On Wed, May 18, 2016 at 11:56:39AM -0400, Waiman Long wrote:
> On 05/18/2016 07:05 AM, Peter Zijlstra wrote:
> >On Tue, May 17, 2016 at 12:46:07PM -0700, Paul E. McKenney wrote:
> >>Actually, if you show a case where this makes a visible system-wide
> >>difference, you could create a set of primitives for #1 below. Have
> >>a compiler version check, and if it is an old compiler, map them to
> >>READ_ONCE() and WRITE_ONCE(), otherwise as follows, though preferably
> >>with better names:
> >>
> >>#define READ_NOTEAR(x) __atomic_load_n(&(x), __ATOMIC_RELAXED)
> >>#define WRITE_NOTEAR(x, v) __atomic_store_n(&(x), (v), __ATOMIC_RELAXED)
> >>
> >>The ambiguity between "no tear" and "not ear" should help motivate a
> >>better choice of name.
> >Alternatively, could we try and talk to our GCC friends to make sure GCC
> >doesn't tear loads/stores irrespective of what the C language spec
> >allows?
>
> Maybe the GCC guys can define a tag which can be set in the variable
> or structure field declarations that those variables or field have
> to be read from or written to atomically. This can allow critical
> data that are used by multiple CPUs to be handled correctly while
> allowing compiler the freedom to do what it sees fit for the less
> critical data. This approach is also easier than looking for all the
> places where the data items are accessed and modifying them.
Having such a tag on gcc's internal data structures is what I want,
regardless of exactly how that tag gets there.
The sorts of things that I am especially concerned about are cases
where there is a union or other type-punning involved, and gcc has
the pieces of the desired location already in registers. Of course,
these pieces came from separate accesses. We really don't need this
kind of thing tripping us up!
Thanx, Paul
next prev parent reply other threads:[~2016-05-18 17:28 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-07 0:20 [PATCH v2] locking/rwsem: Add reader-owned state to the owner field Waiman Long
2016-05-07 4:56 ` Ingo Molnar
2016-05-08 3:04 ` Waiman Long
2016-05-09 8:27 ` Peter Zijlstra
2016-05-10 2:24 ` Waiman Long
2016-05-10 7:02 ` Peter Zijlstra
2016-05-09 18:44 ` Jason Low
2016-05-10 13:03 ` Davidlohr Bueso
2016-05-11 22:04 ` Peter Hurley
2016-05-12 20:15 ` Waiman Long
2016-05-12 21:27 ` Peter Hurley
2016-05-12 23:13 ` Waiman Long
2016-05-13 15:07 ` Peter Zijlstra
2016-05-13 17:58 ` Peter Hurley
2016-05-15 14:47 ` Waiman Long
2016-05-16 11:09 ` Peter Zijlstra
2016-05-16 12:17 ` Paul E. McKenney
2016-05-16 14:17 ` Peter Hurley
2016-05-16 17:22 ` Paul E. McKenney
2016-05-17 19:46 ` Peter Hurley
2016-05-17 19:53 ` Peter Hurley
2016-05-16 17:50 ` Peter Zijlstra
2016-05-17 19:15 ` Peter Hurley
2016-05-17 19:46 ` Paul E. McKenney
2016-05-18 11:05 ` Peter Zijlstra
2016-05-18 15:56 ` Waiman Long
2016-05-18 17:28 ` Paul E. McKenney [this message]
2016-05-18 17:26 ` Paul E. McKenney
2016-05-19 9:00 ` Peter Zijlstra
2016-05-19 13:43 ` Paul E. McKenney
2016-05-19 1:37 ` Dave Chinner
2016-05-19 8:32 ` Peter Zijlstra
2016-05-20 22:56 ` Waiman Long
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=20160518172821.GV3528@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=dave@stgolabs.net \
--cc=david@fromorbit.com \
--cc=dhowells@redhat.com \
--cc=doug.hatch@hpe.com \
--cc=dvyukov@google.com \
--cc=jason.low2@hp.com \
--cc=kcc@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peter@hurleysoftware.com \
--cc=peterz@infradead.org \
--cc=scott.norton@hpe.com \
--cc=waiman.long@hpe.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;
as well as URLs for NNTP newsgroup(s).