From: tip-bot for Alan Stern <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, hpa@zytor.com, paulmck@linux.vnet.ibm.com,
parri.andrea@gmail.com, linux-kernel@vger.kernel.org,
peterz@infradead.org, stern@rowland.harvard.edu,
akiyks@gmail.com, torvalds@linux-foundation.org,
tglx@linutronix.de
Subject: [tip:locking/core] tools/memory-model: Finish the removal of rb-dep, smp_read_barrier_depends(), and lockless_dereference()
Date: Sat, 10 Mar 2018 01:29:11 -0800 [thread overview]
Message-ID: <tip-bd5c0ba2cd78a4c116726ead84f8f37dc92d043e@git.kernel.org> (raw)
In-Reply-To: <1520443660-16858-4-git-send-email-paulmck@linux.vnet.ibm.com>
Commit-ID: bd5c0ba2cd78a4c116726ead84f8f37dc92d043e
Gitweb: https://git.kernel.org/tip/bd5c0ba2cd78a4c116726ead84f8f37dc92d043e
Author: Alan Stern <stern@rowland.harvard.edu>
AuthorDate: Wed, 7 Mar 2018 09:27:40 -0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 10 Mar 2018 10:22:23 +0100
tools/memory-model: Finish the removal of rb-dep, smp_read_barrier_depends(), and lockless_dereference()
Commit:
bf28ae562744 ("tools/memory-model: Remove rb-dep, smp_read_barrier_depends, and lockless_dereference")
was merged too early, while it was still in RFC form. This patch adds in
the missing pieces.
Akira pointed out some typos in the original patch, and he noted that
cheatsheet.txt should indicate that READ_ONCE() now implies an address
dependency. Andrea suggested documenting the relationship betwwen
unsuccessful RMW operations and address dependencies.
Andrea pointed out that the macro for rcu_dereference() in linux.def
should now use the "once" annotation instead of "deref". He also
suggested that the comments should mention commit:
5a8897cc7631 ("locking/atomics/alpha: Add smp_read_barrier_depends() to _release()/_relaxed() atomics")
... as an important precursor, and he contributed commit:
cb13b424e986 ("locking/xchg/alpha: Add unconditional memory barrier to cmpxchg()")
which is another prerequisite.
Suggested-by: Akira Yokosawa <akiyks@gmail.com>
Suggested-by: Andrea Parri <parri.andrea@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
[ Fixed read_read_lock() typo reported by Akira. ]
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Andrea Parri <parri.andrea@gmail.com>
Acked-by: Akira Yokosawa <akiyks@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: boqun.feng@gmail.com
Cc: dhowells@redhat.com
Cc: j.alglave@ucl.ac.uk
Cc: linux-arch@vger.kernel.org
Cc: luc.maranget@inria.fr
Cc: npiggin@gmail.com
Cc: will.deacon@arm.com
Fixes: bf28ae562744 ("tools/memory-model: Remove rb-dep, smp_read_barrier_depends, and lockless_dereference")
Link: http://lkml.kernel.org/r/1520443660-16858-4-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
tools/memory-model/Documentation/cheatsheet.txt | 6 +++---
tools/memory-model/Documentation/explanation.txt | 4 ++--
tools/memory-model/linux-kernel.def | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/memory-model/Documentation/cheatsheet.txt b/tools/memory-model/Documentation/cheatsheet.txt
index 04e458acd6d4..956b1ae4aafb 100644
--- a/tools/memory-model/Documentation/cheatsheet.txt
+++ b/tools/memory-model/Documentation/cheatsheet.txt
@@ -1,11 +1,11 @@
Prior Operation Subsequent Operation
--------------- ---------------------------
C Self R W RWM Self R W DR DW RMW SV
- __ ---- - - --- ---- - - -- -- --- --
+ -- ---- - - --- ---- - - -- -- --- --
Store, e.g., WRITE_ONCE() Y Y
-Load, e.g., READ_ONCE() Y Y Y
-Unsuccessful RMW operation Y Y Y
+Load, e.g., READ_ONCE() Y Y Y Y
+Unsuccessful RMW operation Y Y Y Y
rcu_dereference() Y Y Y Y
Successful *_acquire() R Y Y Y Y Y Y
Successful *_release() C Y Y Y W Y
diff --git a/tools/memory-model/Documentation/explanation.txt b/tools/memory-model/Documentation/explanation.txt
index dae8b8cb2ad3..a727c82bd434 100644
--- a/tools/memory-model/Documentation/explanation.txt
+++ b/tools/memory-model/Documentation/explanation.txt
@@ -826,7 +826,7 @@ A-cumulative; they only affect the propagation of stores that are
executed on C before the fence (i.e., those which precede the fence in
program order).
-read_lock(), rcu_read_unlock(), and synchronize_rcu() fences have
+rcu_read_lock(), rcu_read_unlock(), and synchronize_rcu() fences have
other properties which we discuss later.
@@ -1138,7 +1138,7 @@ final effect is that even though the two loads really are executed in
program order, it appears that they aren't.
This could not have happened if the local cache had processed the
-incoming stores in FIFO order. In constrast, other architectures
+incoming stores in FIFO order. By contrast, other architectures
maintain at least the appearance of FIFO order.
In practice, this difficulty is solved by inserting a special fence
diff --git a/tools/memory-model/linux-kernel.def b/tools/memory-model/linux-kernel.def
index 5dfb9c7f3462..397e4e67e8c8 100644
--- a/tools/memory-model/linux-kernel.def
+++ b/tools/memory-model/linux-kernel.def
@@ -13,7 +13,7 @@ WRITE_ONCE(X,V) { __store{once}(X,V); }
smp_store_release(X,V) { __store{release}(*X,V); }
smp_load_acquire(X) __load{acquire}(*X)
rcu_assign_pointer(X,V) { __store{release}(X,V); }
-rcu_dereference(X) __load{deref}(X)
+rcu_dereference(X) __load{once}(X)
// Fences
smp_mb() { __fence{mb} ; }
next prev parent reply other threads:[~2018-03-10 9:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 17:26 [PATCH tools/memory-model 0/4] Documentation updates and fixes Paul E. McKenney
2018-03-07 17:27 ` [PATCH tools/memory-model 1/4] memory-barriers: More text to de-emphasize smp_read_barrier_depends() Paul E. McKenney
2018-03-07 17:27 ` [PATCH tools/memory-model 2/4] tools/memory-model: Remove mention of docker/gentoo image Paul E. McKenney
2018-03-10 9:28 ` [tip:locking/core] " tip-bot for Paul E. McKenney
2018-03-07 17:27 ` [PATCH tools/memory-model 3/4] tools/memory-order: Add documentation of new litmus test Paul E. McKenney
2018-03-10 9:28 ` [tip:locking/core] tools/memory-model: " tip-bot for Paul E. McKenney
2018-03-07 17:27 ` [PATCH tools/memory-model 4/4] tools/memory-model: Update: Remove rb-dep, smp_read_barrier_depends, and lockless_dereference Paul E. McKenney
2018-03-10 9:29 ` tip-bot for Alan Stern [this message]
2018-03-10 9:27 ` [tip:locking/core] locking/memory-barriers: De-emphasize smp_read_barrier_depends() some more tip-bot for Paul E. McKenney
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=tip-bd5c0ba2cd78a4c116726ead84f8f37dc92d043e@git.kernel.org \
--to=tipbot@zytor.com \
--cc=akiyks@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=parri.andrea@gmail.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=stern@rowland.harvard.edu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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