summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2016-11-16 11:12:49 +0000
committerJonathan Corbet <corbet@lwn.net>2016-11-16 16:17:45 -0700
commit01e4644203b01fba5023784598f4d033e3bd3e28 (patch)
treedae5c8e97588062dea746543ba66cb7917b9b78e
parent47f421221029e8515b71e7e2379eba8406b7f458 (diff)
downloadlinux-rpi-01e4644203b01fba5023784598f4d033e3bd3e28.tar.gz
linux-rpi-01e4644203b01fba5023784598f4d033e3bd3e28.tar.bz2
linux-rpi-01e4644203b01fba5023784598f4d033e3bd3e28.zip
Documentation: circular-buffers: use READ_ONCE()
While the {READ,WRITE}_ONCE() macros should be used in preference to ACCESS_ONCE(), the circular buffer documentation uses the latter exclusively. To point people in the right direction, and as a step towards the eventual removal of ACCESS_ONCE(), update the documentation to use READ_ONCE(), as ACCESS_ONCE() is only used in a reader context in the circular buffer documentation. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Acked-by: David Howells <dhowells@redhat.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r--Documentation/circular-buffers.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/circular-buffers.txt b/Documentation/circular-buffers.txt
index 88951b179262..4a824d232472 100644
--- a/Documentation/circular-buffers.txt
+++ b/Documentation/circular-buffers.txt
@@ -161,7 +161,7 @@ The producer will look something like this:
unsigned long head = buffer->head;
/* The spin_unlock() and next spin_lock() provide needed ordering. */
- unsigned long tail = ACCESS_ONCE(buffer->tail);
+ unsigned long tail = READ_ONCE(buffer->tail);
if (CIRC_SPACE(head, tail, buffer->size) >= 1) {
/* insert one item into the buffer */
@@ -222,7 +222,7 @@ This will instruct the CPU to make sure the index is up to date before reading
the new item, and then it shall make sure the CPU has finished reading the item
before it writes the new tail pointer, which will erase the item.
-Note the use of ACCESS_ONCE() and smp_load_acquire() to read the
+Note the use of READ_ONCE() and smp_load_acquire() to read the
opposition index. This prevents the compiler from discarding and
reloading its cached value - which some compilers will do across
smp_read_barrier_depends(). This isn't strictly needed if you can