Commit f84cfbb0 authored by Chris Metcalf's avatar Chris Metcalf Committed by Paul E. McKenney
Browse files

Documentation/memory-barriers.txt: Fix ACCESS_ONCE thinko



In commit 2ecf8101 ("Documentation/memory-barriers.txt: Add
needed ACCESS_ONCE() calls to memory-barriers.txt") the statement
"Q = P" was converted to "ACCESS_ONCE(Q) = P".  This should have
been "Q = ACCESS_ONCE(P)".  It later became "WRITE_ONCE(Q, P)".
This doesn't match the following text, which is "Q = LOAD P".
Change the statement to be "Q = READ_ONCE(P)".

Signed-off-by: default avatarChris Metcalf <cmetcalf@ezchip.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent c64c4b0f
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -194,7 +194,7 @@ 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
 (*) On any given CPU, dependent memory accesses will be issued in order, with
     respect to itself.  This means that for:
     respect to itself.  This means that for:


	WRITE_ONCE(Q, P); smp_read_barrier_depends(); D = READ_ONCE(*Q);
	Q = READ_ONCE(P); smp_read_barrier_depends(); D = READ_ONCE(*Q);


     the CPU will issue the following memory operations:
     the CPU will issue the following memory operations:


@@ -202,9 +202,9 @@ There are some minimal guarantees that may be expected of a CPU:


     and always in that order.  On most systems, smp_read_barrier_depends()
     and always in that order.  On most systems, smp_read_barrier_depends()
     does nothing, but it is required for DEC Alpha.  The READ_ONCE()
     does nothing, but it is required for DEC Alpha.  The READ_ONCE()
     and WRITE_ONCE() are required to prevent compiler mischief.  Please
     is required to prevent compiler mischief.  Please note that you
     note that you should normally use something like rcu_dereference()
     should normally use something like rcu_dereference() instead of
     instead of open-coding smp_read_barrier_depends().
     open-coding smp_read_barrier_depends().


 (*) Overlapping loads and stores within a particular CPU will appear to be
 (*) Overlapping loads and stores within a particular CPU will appear to be
     ordered within that CPU.  This means that for:
     ordered within that CPU.  This means that for: