From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
fweisbec@gmail.com, oleg@redhat.com,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH tip/core/rcu 17/21] doc: De-emphasize smp_read_barrier_depends
Date: Fri, 1 Dec 2017 11:51:12 -0800 [thread overview]
Message-ID: <1512157876-24665-17-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171201195053.GA23494@linux.vnet.ibm.com>
This commit keeps only the historical and low-level discussion of
smp_read_barrier_depends().
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
Documentation/RCU/Design/Requirements/Requirements.html | 3 ++-
Documentation/RCU/rcu_dereference.txt | 6 +-----
Documentation/RCU/whatisRCU.txt | 3 +--
Documentation/circular-buffers.txt | 3 +--
Documentation/memory-barriers.txt | 7 ++++---
5 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/Documentation/RCU/Design/Requirements/Requirements.html b/Documentation/RCU/Design/Requirements/Requirements.html
index 62e847bcdcdd..571c3d75510f 100644
--- a/Documentation/RCU/Design/Requirements/Requirements.html
+++ b/Documentation/RCU/Design/Requirements/Requirements.html
@@ -581,7 +581,8 @@ This guarantee was only partially premeditated.
DYNIX/ptx used an explicit memory barrier for publication, but had nothing
resembling <tt>rcu_dereference()</tt> for subscription, nor did it
have anything resembling the <tt>smp_read_barrier_depends()</tt>
-that was later subsumed into <tt>rcu_dereference()</tt>.
+that was later subsumed into <tt>rcu_dereference()</tt> and later
+still into <tt>READ_ONCE()</tt>.
The need for these operations made itself known quite suddenly at a
late-1990s meeting with the DEC Alpha architects, back in the days when
DEC was still a free-standing company.
diff --git a/Documentation/RCU/rcu_dereference.txt b/Documentation/RCU/rcu_dereference.txt
index 1acb26b09b48..ab96227bad42 100644
--- a/Documentation/RCU/rcu_dereference.txt
+++ b/Documentation/RCU/rcu_dereference.txt
@@ -122,11 +122,7 @@ o Be very careful about comparing pointers obtained from
Note that if checks for being within an RCU read-side
critical section are not required and the pointer is never
dereferenced, rcu_access_pointer() should be used in place
- of rcu_dereference(). The rcu_access_pointer() primitive
- does not require an enclosing read-side critical section,
- and also omits the smp_read_barrier_depends() included in
- rcu_dereference(), which in turn should provide a small
- performance gain in some CPUs (e.g., the DEC Alpha).
+ of rcu_dereference().
o The comparison is against a pointer that references memory
that was initialized "a long time ago." The reason
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index df62466da4e0..a27fbfb0efb8 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -600,8 +600,7 @@ don't forget about them when submitting patches making use of RCU!]
#define rcu_dereference(p) \
({ \
- typeof(p) _________p1 = p; \
- smp_read_barrier_depends(); \
+ typeof(p) _________p1 = READ_ONCE(p); \
(_________p1); \
})
diff --git a/Documentation/circular-buffers.txt b/Documentation/circular-buffers.txt
index d4628174b7c5..53e51caa3347 100644
--- a/Documentation/circular-buffers.txt
+++ b/Documentation/circular-buffers.txt
@@ -220,8 +220,7 @@ before it writes the new tail pointer, which will erase the item.
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
+reloading its cached value. This isn't strictly needed if you can
be sure that the opposition index will _only_ be used the once.
The smp_load_acquire() additionally forces the CPU to order against
subsequent memory references. Similarly, smp_store_release() is used
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 2269e58fa073..c21a9b25cacf 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -236,9 +236,10 @@ There are some minimal guarantees that may be expected of a CPU:
and always in that order. On most systems, smp_read_barrier_depends()
does nothing, but it is required for DEC Alpha, and is supplied by
READ_ONCE(). The READ_ONCE() is also required to prevent compiler
- mischief. Please note that you should normally use something
+ mischief. Please note that you should almost always use something
like READ_ONCE() or rcu_dereference() instead of open-coding
- smp_read_barrier_depends().
+ smp_read_barrier_depends(), the only exceptions being in DEC Alpha
+ architecture-specific code and in ACCESS_ONCE itself.
(*) Overlapping loads and stores within a particular CPU will appear to be
ordered within that CPU. This means that for:
@@ -1816,7 +1817,7 @@ The Linux kernel has eight basic CPU memory barriers:
GENERAL mb() smp_mb()
WRITE wmb() smp_wmb()
READ rmb() smp_rmb()
- DATA DEPENDENCY read_barrier_depends() smp_read_barrier_depends()
+ DATA DEPENDENCY READ_ONCE()
All memory barriers except the data dependency barriers imply a compiler
--
2.5.2
next prev parent reply other threads:[~2017-12-01 19:54 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-01 19:50 [PATCH tip/core/rcu 0/21] De-emphasize {smp_,}read_barrier_depends Paul E. McKenney
2017-12-01 19:50 ` [PATCH tip/core/rcu 01/21] doc: READ_ONCE() now implies smp_barrier_depends() Paul E. McKenney
2017-12-01 19:50 ` [PATCH tip/core/rcu 02/21] mn10300: READ_ONCE() now implies smp_read_barrier_depends() Paul E. McKenney
2017-12-01 19:50 ` [PATCH tip/core/rcu 03/21] drivers/net/ethernet/qlogic/qed: Fix __qed_spq_block() ordering Paul E. McKenney
2017-12-01 19:50 ` [PATCH tip/core/rcu 04/21] fs/dcache: Use release-acquire for name/length update Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 05/21] percpu: READ_ONCE() now implies smp_read_barrier_depends() Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 06/21] rcu: Adjust read-side accessor comments for READ_ONCE() Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 07/21] rtnetlink: Update now-misleading smp_read_barrier_depends() comment Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 08/21] seqlock: Remove now-redundant smp_read_barrier_depends() Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 09/21] uprobes: " Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 10/21] locking: Remove smp_read_barrier_depends() from queued_spin_lock_slowpath() Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 11/21] tracepoint: Remove smp_read_barrier_depends() from comment Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 12/21] lib/assoc_array: Remove smp_read_barrier_depends() Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 13/21] mm/ksm: Remove now-redundant smp_read_barrier_depends() Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 14/21] netfilter: " Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 15/21] keyring: " Paul E. McKenney
2017-12-04 0:59 ` James Morris
2017-12-04 18:54 ` Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 16/21] drivers/infiniband: " Paul E. McKenney
2017-12-02 0:11 ` Jason Gunthorpe
2017-12-02 1:08 ` Paul E. McKenney
2017-12-05 15:08 ` Jason Gunthorpe
2017-12-05 20:06 ` Paul E. McKenney
2017-12-01 19:51 ` Paul E. McKenney [this message]
2017-12-01 19:51 ` [PATCH tip/core/rcu 18/21] genetlink: Remove smp_read_barrier_depends() from comment Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 19/21] netlink: " Paul E. McKenney
2017-12-01 19:51 ` [PATCH tip/core/rcu 20/21] checkpatch: Add warnings for {smp_,}read_barrier_depends() Paul E. McKenney
2017-12-01 20:14 ` Joe Perches
2017-12-01 21:44 ` Paul E. McKenney
2017-12-02 4:45 ` Joe Perches
2017-12-04 19:06 ` Paul E. McKenney
2017-12-04 19:12 ` Joe Perches
2017-12-01 19:51 ` [PATCH tip/core/rcu 21/21] drivers/vhost: Remove now-redundant read_barrier_depends() Paul E. McKenney
2017-12-05 18:31 ` Michael S. Tsirkin
2017-12-05 18:39 ` Peter Zijlstra
2017-12-05 18:57 ` Michael S. Tsirkin
2017-12-05 19:17 ` Peter Zijlstra
2017-12-05 19:24 ` Michael S. Tsirkin
2017-12-05 19:33 ` Paul E. McKenney
2017-12-05 19:51 ` Michael S. Tsirkin
2017-12-05 19:57 ` Peter Zijlstra
2017-12-05 20:28 ` Michael S. Tsirkin
2017-12-05 21:17 ` Peter Zijlstra
2017-12-05 21:42 ` Michael S. Tsirkin
2017-12-05 20:08 ` Paul E. McKenney
2017-12-05 21:24 ` Michael S. Tsirkin
2017-12-05 21:36 ` Paul E. McKenney
2017-12-05 21:43 ` Michael S. Tsirkin
2017-12-05 22:02 ` Paul E. McKenney
2017-12-05 22:09 ` Peter Zijlstra
2017-12-05 21:57 ` Peter Zijlstra
2017-12-05 22:09 ` Michael S. Tsirkin
2017-12-05 23:39 ` Paul E. McKenney
2017-12-05 19:55 ` Peter Zijlstra
2017-12-04 15:38 ` [PATCH tip/core/rcu 01/21] doc: READ_ONCE() now implies smp_barrier_depends() David Howells
2017-12-04 18:52 ` Paul E. McKenney
2017-12-04 21:54 ` Peter Zijlstra
2017-12-04 22:15 ` Paul E. McKenney
2017-12-04 22:39 ` David Howells
2017-12-04 22:57 ` Peter Zijlstra
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=1512157876-24665-17-git-send-email-paulmck@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=edumazet@google.com \
--cc=fweisbec@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--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;
as well as URLs for NNTP newsgroup(s).