Messages in this thread | | | Date | Thu, 21 Nov 2013 11:43:35 -0800 | From | Josh Triplett <> | Subject | Re: [PATCH RFC tip/core/rcu 1/3] documentation: Add needed ACCESS_ONCE() calls to memory-barriers.txt |
| |
On Thu, Nov 21, 2013 at 09:48:45AM -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. > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> > Cc: David Howells <dhowells@redhat.com> > --- > Documentation/memory-barriers.txt | 204 +++++++++++++++++++++++--------------- > 1 file changed, 124 insertions(+), 80 deletions(-) > > diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt > index c8c42e64e953..eccc83a40ce1 100644 > --- a/Documentation/memory-barriers.txt > +++ b/Documentation/memory-barriers.txt > @@ -194,18 +194,20 @@ There are some minimal guarantees that may be expected of a CPU: > (*) On any given CPU, dependent memory accesses will be issued in order, with > respect to itself. This means that for: > > - Q = P; D = *Q; > + ACCESS_ONCE(Q) = P; smp_memory_barrier_depends(); D = ACCESS_ONCE(*Q);
That should be smp_read_barrier_depends().
Also, most of the time shouldn't that use rcu_dereference rather than a raw smp_read_barrier_depends()?
- Josh Triplett
| |