LKMM updates for v5.12
Paul E. McKenney
maintainercover LKMM updates for v5.12
Hello!
This series provides a few LKMM updates:
1. tools/memory-model: Tie acquire loads to reads-from.
2. tools/memory-model: Remove redundant initialization in litmus
tests, courtesy of Akira Yokosawa.
3. tools/memory-model: Fix typo in klitmus7 compatibility table,
courtesy of Akira Yokosawa.
Thanx, Paul
------------------------------------------------------------------------
Documentation/glossary.txt | 12 +++++++--- README | 2 - litmus-tests/CoRR+poonceonce+Once.litmus | 4 --- litmus-tests/CoRW+poonceonce+Once.litmus | 4 --- litmus-tests/CoWR+poonceonce+Once.litmus | 4 --- litmus-tests/CoWW+poonceonce.litmus | 4 --- litmus-tests/IRIW+fencembonceonces+OnceOnce.litmus | 5 ---- litmus-tests/IRIW+poonceonces+OnceOnce.litmus | 5 ---- litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus | 7 ----- litmus-tests/ISA2+poonceonces.litmus | 6 ----- litmus-tests/ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus | 6 ----- litmus-tests/LB+fencembonceonce+ctrlonceonce.litmus | 5 ---- litmus-tests/LB+poacquireonce+pooncerelease.litmus | 5 ---- litmus-tests/LB+poonceonces.litmus | 5 ---- litmus-tests/MP+fencewmbonceonce+fencermbonceonce.litmus | 5 ---- litmus-tests/MP+onceassign+derefonce.litmus | 4 --- litmus-tests/MP+polockmbonce+poacquiresilsil.litmus | 5 ---- litmus-tests/MP+polockonce+poacquiresilsil.litmus | 5 ---- litmus-tests/MP+polocks.litmus | 6 ----- litmus-tests/MP+poonceonces.litmus | 5 ---- litmus-tests/MP+pooncerelease+poacquireonce.litmus | 5 ---- litmus-tests/MP+porevlocks.litmus | 6 ----- litmus-tests/R+fencembonceonces.litmus | 5 ---- litmus-tests/R+poonceonces.litmus | 5 ---- litmus-tests/S+fencewmbonceonce+poacquireonce.litmus | 5 ---- litmus-tests/S+poonceonces.litmus | 5 ---- litmus-tests/SB+fencembonceonces.litmus | 5 ---- litmus-tests/SB+poonceonces.litmus | 5 ---- litmus-tests/SB+rfionceonce-poonceonces.litmus | 5 ---- litmus-tests/WRC+poonceonces+Once.litmus | 5 ---- litmus-tests/WRC+pooncerelease+fencermbonceonce+Once.litmus | 5 ---- litmus-tests/Z6.0+pooncelock+poonceLock+pombonce.litmus | 7 ----- litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus | 7 ----- litmus-tests/Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus | 6 ----- 34 files changed, 42 insertions(+), 138 deletions(-)
[email protected]
maintainerPATCH 1/3 tools/memory-model: Tie acquire loads to reads-from
From: "Paul E. McKenney" <[email protected]>
This commit explicitly makes the connection between acquire loads and the reads-from relation. It also adds an entry for happens-before, and refers to the corresponding section of explanation.txt.
--- tools/memory-model/Documentation/glossary.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
tools/memory-model/Documentation/glossary.txt +9 -3
@@ -33,10 +33,11 @@ Acquire: With respect to a lock, acquiring that lock, for example, acquire loads. When an acquire load returns the value stored by a release store - to that same variable, then all operations preceding that store - happen before any operations following that load acquire. + to that same variable, (in other words, the acquire load "reads + from" the release store), then all operations preceding that + store "happen before" any operations following that load acquire. - See also "Relaxed" and "Release". + See also "Happens-Before", "Reads-From", "Relaxed", and "Release". Coherence (co): When one CPU's store to a given variable overwrites either the value from another CPU's store or some later value,
@@ -119,6 +120,11 @@ Fully Ordered: An operation such as smp_mb() that orders all of that orders all of its CPU's prior accesses, itself, and all of its CPU's subsequent accesses. +Happens-Before (hb): A relation between two accesses in which LKMM + guarantees the first access precedes the second. For more + detail, please see the "THE HAPPENS-BEFORE RELATION: hb" + section of explanation.txt. + Marked Access: An access to a variable that uses an special function or macro such as "r1 = READ_ONCE(x)" or "smp_store_release(&a, 1)".
Signature · 1 line
2.9.5
[email protected]
maintainerPATCH 2/3 tools/memory-model: Remove redundant initialization in litmus tests
In reply to Paul E. McKenneyFrom: Akira Yokosawa <[email protected]>
This is a revert of commit 1947bfcf81a9 ("tools/memory-model: Add types to litmus tests") with conflict resolutions.
klitmus7 [1] is aware of default types of "int" and "int*". It accepts litmus tests for herd7 without extra type info unless non-"int" variables are referenced by an "exists", "locations", or "filter" directive.
[1]: Tested with klitmus7 versions 7.49 or later.
--- tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus | 4 +--- tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus | 4 +--- tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus | 4 +--- tools/memory-model/litmus-tests/CoWW+poonceonce.litmus | 4 +--- .../litmus-tests/IRIW+fencembonceonces+OnceOnce.litmus | 5 +---- tools/memory-model/litmus-tests/IRIW+poonceonces+OnceOnce.litmus | 5 +---- .../litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus | 7 +------ tools/memory-model/litmus-tests/ISA2+poonceonces.litmus | 6 +----- .../ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus | 6 +----- .../litmus-tests/LB+fencembonceonce+ctrlonceonce.litmus | 5 +---- .../litmus-tests/LB+poacquireonce+pooncerelease.litmus | 5 +---- tools/memory-model/litmus-tests/LB+poonceonces.litmus | 5 +---- .../litmus-tests/MP+fencewmbonceonce+fencermbonceonce.litmus | 5 +---- tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus | 4 +--- .../litmus-tests/MP+polockmbonce+poacquiresilsil.litmus | 5 +---- .../memory-model/litmus-tests/MP+polockonce+poacquiresilsil.litmus | 5 +---- tools/memory-model/litmus-tests/MP+polocks.litmus | 6 +----- tools/memory-model/litmus-tests/MP+poonceonces.litmus | 5 +---- .../litmus-tests/MP+pooncerelease+poacquireonce.litmus | 5 +---- tools/memory-model/litmus-tests/MP+porevlocks.litmus | 6 +----- tools/memory-model/litmus-tests/R+fencembonceonces.litmus | 5 +---- tools/memory-model/litmus-tests/R+poonceonces.litmus | 5 +---- .../litmus-tests/S+fencewmbonceonce+poacquireonce.litmus | 5 +---- tools/memory-model/litmus-tests/S+poonceonces.litmus | 5 +---- tools/memory-model/litmus-tests/SB+fencembonceonces.litmus | 5 +---- tools/memory-model/litmus-tests/SB+poonceonces.litmus | 5 +---- tools/memory-model/litmus-tests/SB+rfionceonce-poonceonces.litmus | 5 +---- tools/memory-model/litmus-tests/WRC+poonceonces+Once.litmus | 5 +---- .../litmus-tests/WRC+pooncerelease+fencermbonceonce+Once.litmus | 5 +---- .../litmus-tests/Z6.0+pooncelock+poonceLock+pombonce.litmus | 7 +------ .../litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus | 7 +------ .../Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus | 6 +----- 32 files changed, 32 insertions(+), 134 deletions(-)
tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus +1 -3
@@ -7,9 +7,7 @@ C CoRR+poonceonce+Once * reads from the same variable are ordered. *) -{ - int x; -} +{} P0(int *x) {
tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus +1 -3
@@ -7,9 +7,7 @@ C CoRW+poonceonce+Once * a given variable and a later write to that same variable are ordered. *) -{ - int x; -} +{} P0(int *x) {
tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus +1 -3
@@ -7,9 +7,7 @@ C CoWR+poonceonce+Once * given variable and a later read from that same variable are ordered. *) -{ - int x; -} +{} P0(int *x) {
tools/memory-model/litmus-tests/CoWW+poonceonce.litmus +1 -3
@@ -7,9 +7,7 @@ C CoWW+poonceonce * writes to the same variable are ordered. *) -{ - int x; -} +{} P0(int *x) {
tools/memory-model/litmus-tests/IRIW+fencembonceonces+OnceOnce.litmus +1 -4
@@ -10,10 +10,7 @@ C IRIW+fencembonceonces+OnceOnce * process? This litmus test exercises LKMM's "propagation" rule. *) -{ - int x; - int y; -} +{} P0(int *x) {
tools/memory-model/litmus-tests/IRIW+poonceonces+OnceOnce.litmus +1 -4
@@ -10,10 +10,7 @@ C IRIW+poonceonces+OnceOnce * different process? *) -{ - int x; - int y; -} +{} P0(int *x) {
tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus +1 -6
@@ -7,12 +7,7 @@ C ISA2+pooncelock+pooncelock+pombonce * (in P0() and P1()) is visible to external process P2(). *) -{ - spinlock_t mylock; - int x; - int y; - int z; -} +{} P0(int *x, int *y, spinlock_t *mylock) {
tools/memory-model/litmus-tests/ISA2+poonceonces.litmus +1 -5
@@ -9,11 +9,7 @@ C ISA2+poonceonces * of the smp_load_acquire() invocations are replaced by READ_ONCE()? *) -{ - int x; - int y; - int z; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus +1 -5
@@ -11,11 +11,7 @@ C ISA2+pooncerelease+poacquirerelease+poacquireonce * (AKA non-rf) link, so release-acquire is all that is needed. *) -{ - int x; - int y; - int z; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/LB+fencembonceonce+ctrlonceonce.litmus +1 -4
@@ -11,10 +11,7 @@ C LB+fencembonceonce+ctrlonceonce * another control dependency and order would still be maintained.) *) -{ - int x; - int y; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/LB+poacquireonce+pooncerelease.litmus +1 -4
@@ -8,10 +8,7 @@ C LB+poacquireonce+pooncerelease * to the other? *) -{ - int x; - int y; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/LB+poonceonces.litmus +1 -4
@@ -7,10 +7,7 @@ C LB+poonceonces * be prevented even with no explicit ordering? *) -{ - int x; - int y; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/MP+fencewmbonceonce+fencermbonceonce.litmus +1 -4
@@ -8,10 +8,7 @@ C MP+fencewmbonceonce+fencermbonceonce * is usually better to use smp_store_release() and smp_load_acquire(). *) -{ - int buf; - int flag; -} +{} P0(int *buf, int *flag) // Producer {
tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus +1 -3
@@ -10,9 +10,7 @@ C MP+onceassign+derefonce *) { - int *p=y; - int x; - int y=0; +p=y; } P0(int *x, int **p) // Producer
tools/memory-model/litmus-tests/MP+polockmbonce+poacquiresilsil.litmus +1 -4
@@ -10,10 +10,7 @@ C MP+polockmbonce+poacquiresilsil * executed before the lock was acquired (loosely speaking). *) -{ - spinlock_t lo; - int x; -} +{} P0(spinlock_t *lo, int *x) // Producer {
tools/memory-model/litmus-tests/MP+polockonce+poacquiresilsil.litmus +1 -4
@@ -10,10 +10,7 @@ C MP+polockonce+poacquiresilsil * speaking). *) -{ - spinlock_t lo; - int x; -} +{} P0(spinlock_t *lo, int *x) // Producer {
tools/memory-model/litmus-tests/MP+polocks.litmus +1 -5
@@ -11,11 +11,7 @@ C MP+polocks * to see all prior accesses by those other CPUs. *) -{ - spinlock_t mylock; - int buf; - int flag; -} +{} P0(int *buf, int *flag, spinlock_t *mylock) // Producer {
tools/memory-model/litmus-tests/MP+poonceonces.litmus +1 -4
@@ -7,10 +7,7 @@ C MP+poonceonces * no ordering at all? *) -{ - int buf; - int flag; -} +{} P0(int *buf, int *flag) // Producer {
tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus +1 -4
@@ -8,10 +8,7 @@ C MP+pooncerelease+poacquireonce * pattern. *) -{ - int buf; - int flag; -} +{} P0(int *buf, int *flag) // Producer {
tools/memory-model/litmus-tests/MP+porevlocks.litmus +1 -5
@@ -11,11 +11,7 @@ C MP+porevlocks * see all prior accesses by those other CPUs. *) -{ - spinlock_t mylock; - int buf; - int flag; -} +{} P0(int *buf, int *flag, spinlock_t *mylock) // Consumer {
tools/memory-model/litmus-tests/R+fencembonceonces.litmus +1 -4
@@ -9,10 +9,7 @@ C R+fencembonceonces * cause the resulting test to be allowed. *) -{ - int x; - int y; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/R+poonceonces.litmus +1 -4
@@ -8,10 +8,7 @@ C R+poonceonces * store propagation delays. *) -{ - int x; - int y; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/S+fencewmbonceonce+poacquireonce.litmus +1 -4
@@ -7,10 +7,7 @@ C S+fencewmbonceonce+poacquireonce * store against a subsequent store? *) -{ - int x; - int y; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/S+poonceonces.litmus +1 -4
@@ -9,10 +9,7 @@ C S+poonceonces * READ_ONCE(), is ordering preserved? *) -{ - int x; - int y; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/SB+fencembonceonces.litmus +1 -4
@@ -9,10 +9,7 @@ C SB+fencembonceonces * suffice, but not much else.) *) -{ - int x; - int y; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/SB+poonceonces.litmus +1 -4
@@ -8,10 +8,7 @@ C SB+poonceonces * variable that the preceding process reads. *) -{ - int x; - int y; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/SB+rfionceonce-poonceonces.litmus +1 -4
@@ -6,10 +6,7 @@ C SB+rfionceonce-poonceonces * This litmus test demonstrates that LKMM is not fully multicopy atomic. *) -{ - int x; - int y; -} +{} P0(int *x, int *y) {
tools/memory-model/litmus-tests/WRC+poonceonces+Once.litmus +1 -4
@@ -8,10 +8,7 @@ C WRC+poonceonces+Once * test has no ordering at all. *) -{ - int x; - int y; -} +{} P0(int *x) {
tools/memory-model/litmus-tests/WRC+pooncerelease+fencermbonceonce+Once.litmus +1 -4
@@ -10,10 +10,7 @@ C WRC+pooncerelease+fencermbonceonce+Once * is A-cumulative in LKMM. *) -{ - int x; - int y; -} +{} P0(int *x) {
tools/memory-model/litmus-tests/Z6.0+pooncelock+poonceLock+pombonce.litmus +1 -6
@@ -9,12 +9,7 @@ C Z6.0+pooncelock+poonceLock+pombonce * by CPUs not holding that lock. *) -{ - spinlock_t mylock; - int x; - int y; - int z; -} +{} P0(int *x, int *y, spinlock_t *mylock) {
tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus +1 -6
@@ -8,12 +8,7 @@ C Z6.0+pooncelock+pooncelock+pombonce * seen as ordered by a third process not holding that lock. *) -{ - spinlock_t mylock; - int x; - int y; - int z; -} +{} P0(int *x, int *y, spinlock_t *mylock) {
tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus +1 -5
@@ -14,11 +14,7 @@ C Z6.0+pooncerelease+poacquirerelease+fencembonceonce * involving locking.) *) -{ - int x; - int y; - int z; -} +{} P0(int *x, int *y) {
Signature · 1 line
2.9.5
[email protected]
maintainerPATCH 3/3 tools/memory-model: Fix typo in klitmus7 compatibility table
In reply to Paul E. McKenneyFrom: Akira Yokosawa <[email protected]>
klitmus7 of herdtools7 7.48 or earlier depends on ACCESS_ONCE(), which was removed in Linux v4.15.
Fix the obvious typo in the table.
--- tools/memory-model/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/memory-model/README +1 -1
@@ -51,7 +51,7 @@ klitmus7 Compatibility Table ============ ========== target Linux herdtools7 ------------ ---------- - -- 4.18 7.48 -- + -- 4.14 7.48 -- 4.15 -- 4.19 7.49 -- 4.20 -- 5.5 7.54 -- 5.6 -- 7.56 --
Signature · 1 line
2.9.5