summaryrefslogtreecommitdiffstats
path: root/tools/memory-model
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.ibm.com>2018-11-26 17:26:43 -0500
committerPaul E. McKenney <paulmck@linux.ibm.com>2019-03-18 13:27:52 -0400
commitad9fd20b6dadb0cb14551477fcebe0fdf2e697dd (patch)
tree34d9ed743cec5b55c8a33ce120a69f908de8b3fb /tools/memory-model
parenta3f600d92da564ad35f237c8aeab268ca49377cc (diff)
tools/memory-model: Update README for addition of SRCU
This commit updates the section on LKMM limitations to no longer say that SRCU is not modeled, but instead describe how LKMM's modeling of SRCU departs from the Linux-kernel implementation. TL;DR: There is no known valid use case that cares about the Linux kernel's ability to have partially overlapping SRCU read-side critical sections. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> Acked-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Diffstat (limited to 'tools/memory-model')
-rw-r--r--tools/memory-model/README25
1 files changed, 23 insertions, 2 deletions
diff --git a/tools/memory-model/README b/tools/memory-model/README
index 0f2c366518c6..9d7d4f23503f 100644
--- a/tools/memory-model/README
+++ b/tools/memory-model/README
@@ -221,8 +221,29 @@ The Linux-kernel memory model has the following limitations:
221 additional call_rcu() process to the site of the 221 additional call_rcu() process to the site of the
222 emulated rcu-barrier(). 222 emulated rcu-barrier().
223 223
224 e. Sleepable RCU (SRCU) is not modeled. It can be 224 e. Although sleepable RCU (SRCU) is now modeled, there
225 emulated, but perhaps not simply. 225 are some subtle differences between its semantics and
226 those in the Linux kernel. For example, the kernel
227 might interpret the following sequence as two partially
228 overlapping SRCU read-side critical sections:
229
230 1 r1 = srcu_read_lock(&my_srcu);
231 2 do_something_1();
232 3 r2 = srcu_read_lock(&my_srcu);
233 4 do_something_2();
234 5 srcu_read_unlock(&my_srcu, r1);
235 6 do_something_3();
236 7 srcu_read_unlock(&my_srcu, r2);
237
238 In contrast, LKMM will interpret this as a nested pair of
239 SRCU read-side critical sections, with the outer critical
240 section spanning lines 1-7 and the inner critical section
241 spanning lines 3-5.
242
243 This difference would be more of a concern had anyone
244 identified a reasonable use case for partially overlapping
245 SRCU read-side critical sections. For more information,
246 please see: https://paulmck.livejournal.com/40593.html
226 247
227 f. Reader-writer locking is not modeled. It can be 248 f. Reader-writer locking is not modeled. It can be
228 emulated in litmus tests using atomic read-modify-write 249 emulated in litmus tests using atomic read-modify-write