From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
laijs@cn.fujitsu.com, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de,
rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu
Subject: Re: [PATCH v2 RFC 1/3] documentation: Add needed ACCESS_ONCE() calls to memory-barriers.txt
Date: Thu, 21 Nov 2013 14:32:30 -0800 [thread overview]
Message-ID: <20131121223230.GI4138@linux.vnet.ibm.com> (raw)
In-Reply-To: <20131121221821.GB16796@laptop.programming.kicks-ass.net>
On Thu, Nov 21, 2013 at 11:18:21PM +0100, Peter Zijlstra wrote:
> On Thu, Nov 21, 2013 at 02:09:51PM -0800, Paul E. McKenney wrote:
> > On Thu, Nov 21, 2013 at 10:55:17PM +0100, Peter Zijlstra wrote:
> > > On Thu, Nov 21, 2013 at 01:31:27PM -0800, Paul E. McKenney wrote:
> > > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > >
> > > > The Documentation/memory-barriers.txt file was written before the need
> > > > for ACCESS_ONCE() was fully appreciated. It therefore contains no
> > > > ACCESS_ONCE() calls, which can be a problem when people lift examples
> > > > from it. This commit therefore adds ACCESS_ONCE() calls.
> > >
> > > So I find the repeated ACCESS_ONCE() significantly detracts from the
> > > readability of the text.
> > >
> > > Can't we simply state that all accesses are assumed single-copy atomic
> > > and this can be achieved for naturally aligned words using ACCESS_ONCE()
> > > in C/C++ ?
> >
> > We could, but at the moment I would prefer the decrease in readability
> > to the copy-and-paste bugs that omit needed ACCESS_ONCE() calls.
> >
> > Is there some way to get both ACCESS_ONCE() and readability? An
> > abbreviation such as AO()? More easily distinguished variable names?
> > Something else?
>
> Use a form that looks less like C and thus defeats copy/paste?
My concern with that approach is that there is likely to be a large
number of people who are likely to be willing and able to transcribe
from any reasonable non-C form to ACCESS_ONCE()-free C code. :-/
But maybe you have something specific in mind?
Thanx, Paul
next prev parent reply other threads:[~2013-11-21 22:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 21:30 [PATCH v2 RFC 0/3] Memory-barrier documentation updates Paul E. McKenney
2013-11-21 21:31 ` [PATCH v2 RFC 1/3] documentation: Add needed ACCESS_ONCE() calls to memory-barriers.txt Paul E. McKenney
2013-11-21 21:31 ` [PATCH v2 RFC 2/3] documentation: Add long atomic examples " Paul E. McKenney
2013-11-21 21:55 ` [PATCH v2 RFC 1/3] documentation: Add needed ACCESS_ONCE() calls " Peter Zijlstra
2013-11-21 22:09 ` Paul E. McKenney
2013-11-21 22:18 ` Peter Zijlstra
2013-11-21 22:32 ` Paul E. McKenney [this message]
2013-11-22 11:17 ` Peter Zijlstra
2013-11-22 18:54 ` Paul E. McKenney
2013-11-22 15:39 ` Peter Zijlstra
2013-11-22 18:13 ` Paul E. McKenney
2013-11-23 9:04 ` Peter Zijlstra
2013-11-23 17:17 ` Paul E. McKenney
2013-12-04 0:47 ` Paul E. McKenney
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=20131121223230.GI4138@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=darren@dvhart.com \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=edumazet@google.com \
--cc=fweisbec@gmail.com \
--cc=josh@joshtriplett.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=niv@us.ibm.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sbw@mit.edu \
--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