From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Boqun Feng <boqun.feng@gmail.com>
Cc: Akira Yokosawa <akiyks@gmail.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] documentation: Fix two-CPU control-dependency example
Date: Fri, 21 Jul 2017 09:31:59 -0700 [thread overview]
Message-ID: <20170721163159.GE3730@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170721002440.m6e5sdsa53lxygo4@tardis>
On Fri, Jul 21, 2017 at 08:24:40AM +0800, Boqun Feng wrote:
> On Thu, Jul 20, 2017 at 04:07:14PM -0700, Paul E. McKenney wrote:
> [...]
> > >
> > > So if I respin the patch with the extern, would you still feel reluctant?
> >
> > Yes, because I am not seeing how this change helps. What is this telling
> > the reader that the original did not, and how does it help the reader
> > generate good concurrent code?
>
> One thing I think we probably should do is to make READ_ONCE() semantics
> more clear, i.e. call it out that in our conceptual model for kernel
> programming we always rely on the compiler to be serious about the
> return value of READ_ONCE(). I didn't find the comment before
> READ_ONCE() or memory-barriers.txt talking about something similar.
>
> Or am I the only one having this kinda semantics guarantee in mind?
That sounds like a good idea to me. The C++ standards committee might
be reluctant to provide a good definition of "volatile", but we can at
least provide a definition of our own. It should be possible to leverage
the need for "volatile" to support MMIO accesses, as there is general
agreement that this was and still is its main purpose. Given those
guarantees, there is no reason we cannot apply them in other situations,
for example, interacting with irq handlers and preventing inappropriate
optimizations for concurrent code.
Even better, with tests to find compiler bugs in this area!
Thanx, Paul
next prev parent reply other threads:[~2017-07-21 16:32 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-17 8:24 [PATCH] documentation: Fix two-CPU control-dependency example Akira Yokosawa
2017-07-19 17:43 ` Paul E. McKenney
2017-07-19 21:33 ` Akira Yokosawa
2017-07-19 21:56 ` Paul E. McKenney
2017-07-20 1:31 ` Boqun Feng
2017-07-20 5:47 ` Paul E. McKenney
2017-07-20 6:14 ` Boqun Feng
2017-07-20 12:52 ` Paul E. McKenney
2017-07-20 12:55 ` Akira Yokosawa
2017-07-20 16:11 ` Paul E. McKenney
2017-07-20 21:12 ` Akira Yokosawa
2017-07-20 21:42 ` Paul E. McKenney
2017-07-20 22:52 ` Akira Yokosawa
2017-07-20 23:07 ` Paul E. McKenney
2017-07-21 0:24 ` Boqun Feng
2017-07-21 16:31 ` Paul E. McKenney [this message]
2017-07-21 23:38 ` Akira Yokosawa
2017-07-23 4:43 ` Paul E. McKenney
2017-07-23 15:39 ` Boqun Feng
2017-07-24 0:04 ` Akira Yokosawa
2017-07-24 4:36 ` Paul E. McKenney
2017-07-24 6:34 ` Boqun Feng
2017-07-24 10:47 ` Akira Yokosawa
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=20170721163159.GE3730@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akiyks@gmail.com \
--cc=boqun.feng@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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