[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131121221821.GB16796@laptop.programming.kicks-ass.net>
Date: Thu, 21 Nov 2013 23:18:21 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org,
laijs@...fujitsu.com, dipankar@...ibm.com,
akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
josh@...htriplett.org, niv@...ibm.com, tglx@...utronix.de,
rostedt@...dmis.org, dhowells@...hat.com, edumazet@...gle.com,
darren@...art.com, fweisbec@...il.com, sbw@....edu
Subject: Re: [PATCH v2 RFC 1/3] documentation: Add needed ACCESS_ONCE() calls
to memory-barriers.txt
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@...ux.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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists