>From 3a871845825d96a23d64be05b6cf6d4af2bae167 Mon Sep 17 00:00:00 2001 From: Akira Yokosawa <akiyks@xxxxxxxxx> Date: Sat, 28 Nov 2020 08:43:45 +0900 Subject: [PATCH 1/2] tools/memory-model: Remove redundant initialization in litmus tests 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. Suggested-by: Paul E. McKenney <paulmck@xxxxxxxxxx> Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> --- .../memory-model/litmus-tests/CoRR+poonceonce+Once.litmus | 4 +--- .../memory-model/litmus-tests/CoRW+poonceonce+Once.litmus | 4 +--- .../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 +---- .../litmus-tests/IRIW+poonceonces+OnceOnce.litmus | 5 +---- .../ISA2+pooncelock+pooncelock+pombonce.litmus | 7 +------ tools/memory-model/litmus-tests/ISA2+poonceonces.litmus | 6 +----- ...SA2+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 +---- .../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 +---- 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 +---- .../litmus-tests/SB+rfionceonce-poonceonces.litmus | 5 +---- .../memory-model/litmus-tests/WRC+poonceonces+Once.litmus | 5 +---- .../WRC+pooncerelease+fencermbonceonce+Once.litmus | 5 +---- .../Z6.0+pooncelock+poonceLock+pombonce.litmus | 7 +------ .../Z6.0+pooncelock+pooncelock+pombonce.litmus | 7 +------ ...0+pooncerelease+poacquirerelease+fencembonceonce.litmus | 6 +----- 32 files changed, 32 insertions(+), 134 deletions(-) diff --git a/tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus b/tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus index 772544f03fb5..967f9f2a6226 100644 --- a/tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus +++ b/tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus @@ -7,9 +7,7 @@ C CoRR+poonceonce+Once * reads from the same variable are ordered. *) -{ - int x; -} +{} P0(int *x) { diff --git a/tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus b/tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus index 5faae98f7ffb..4635739f3974 100644 --- a/tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus +++ b/tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus @@ -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) { diff --git a/tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus b/tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus index 77c9cc9f8dc6..bb068c92d8da 100644 --- a/tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus +++ b/tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus @@ -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) { diff --git a/tools/memory-model/litmus-tests/CoWW+poonceonce.litmus b/tools/memory-model/litmus-tests/CoWW+poonceonce.litmus index 85ef746f511a..0d9f0a958799 100644 --- a/tools/memory-model/litmus-tests/CoWW+poonceonce.litmus +++ b/tools/memory-model/litmus-tests/CoWW+poonceonce.litmus @@ -7,9 +7,7 @@ C CoWW+poonceonce * writes to the same variable are ordered. *) -{ - int x; -} +{} P0(int *x) { diff --git a/tools/memory-model/litmus-tests/IRIW+fencembonceonces+OnceOnce.litmus b/tools/memory-model/litmus-tests/IRIW+fencembonceonces+OnceOnce.litmus index 87aa900125ab..e729d2776e89 100644 --- a/tools/memory-model/litmus-tests/IRIW+fencembonceonces+OnceOnce.litmus +++ b/tools/memory-model/litmus-tests/IRIW+fencembonceonces+OnceOnce.litmus @@ -10,10 +10,7 @@ C IRIW+fencembonceonces+OnceOnce * process? This litmus test exercises LKMM's "propagation" rule. *) -{ - int x; - int y; -} +{} P0(int *x) { diff --git a/tools/memory-model/litmus-tests/IRIW+poonceonces+OnceOnce.litmus b/tools/memory-model/litmus-tests/IRIW+poonceonces+OnceOnce.litmus index f84022dca555..4b54dd6a6cd9 100644 --- a/tools/memory-model/litmus-tests/IRIW+poonceonces+OnceOnce.litmus +++ b/tools/memory-model/litmus-tests/IRIW+poonceonces+OnceOnce.litmus @@ -10,10 +10,7 @@ C IRIW+poonceonces+OnceOnce * different process? *) -{ - int x; - int y; -} +{} P0(int *x) { diff --git a/tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus b/tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus index 398f624daa77..094d58df7789 100644 --- a/tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus +++ b/tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus @@ -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) { diff --git a/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus b/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus index 212a432ba16b..b321aa6f4ea5 100644 --- a/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus @@ -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) { diff --git a/tools/memory-model/litmus-tests/ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus b/tools/memory-model/litmus-tests/ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus index 7afd85672ccd..025b0462ec9b 100644 --- a/tools/memory-model/litmus-tests/ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus +++ b/tools/memory-model/litmus-tests/ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus @@ -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) { diff --git a/tools/memory-model/litmus-tests/LB+fencembonceonce+ctrlonceonce.litmus b/tools/memory-model/litmus-tests/LB+fencembonceonce+ctrlonceonce.litmus index c8a93c7ee556..4727f5aaf03b 100644 --- a/tools/memory-model/litmus-tests/LB+fencembonceonce+ctrlonceonce.litmus +++ b/tools/memory-model/litmus-tests/LB+fencembonceonce+ctrlonceonce.litmus @@ -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) { diff --git a/tools/memory-model/litmus-tests/LB+poacquireonce+pooncerelease.litmus b/tools/memory-model/litmus-tests/LB+poacquireonce+pooncerelease.litmus index 2fa029568fa1..07b9904b0e49 100644 --- a/tools/memory-model/litmus-tests/LB+poacquireonce+pooncerelease.litmus +++ b/tools/memory-model/litmus-tests/LB+poacquireonce+pooncerelease.litmus @@ -8,10 +8,7 @@ C LB+poacquireonce+pooncerelease * to the other? *) -{ - int x; - int y; -} +{} P0(int *x, int *y) { diff --git a/tools/memory-model/litmus-tests/LB+poonceonces.litmus b/tools/memory-model/litmus-tests/LB+poonceonces.litmus index 2107306e8625..74c49cb3c37b 100644 --- a/tools/memory-model/litmus-tests/LB+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/LB+poonceonces.litmus @@ -7,10 +7,7 @@ C LB+poonceonces * be prevented even with no explicit ordering? *) -{ - int x; - int y; -} +{} P0(int *x, int *y) { diff --git a/tools/memory-model/litmus-tests/MP+fencewmbonceonce+fencermbonceonce.litmus b/tools/memory-model/litmus-tests/MP+fencewmbonceonce+fencermbonceonce.litmus index c5c168d92973..f8ca1229857a 100644 --- a/tools/memory-model/litmus-tests/MP+fencewmbonceonce+fencermbonceonce.litmus +++ b/tools/memory-model/litmus-tests/MP+fencewmbonceonce+fencermbonceonce.litmus @@ -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 { diff --git a/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus b/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus index 20ff62649f1e..d84160b9c1ae 100644 --- a/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus +++ b/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus @@ -10,9 +10,7 @@ C MP+onceassign+derefonce *) { - int *p=y; - int x; - int y=0; +p=y; } P0(int *x, int **p) // Producer diff --git a/tools/memory-model/litmus-tests/MP+polockmbonce+poacquiresilsil.litmus b/tools/memory-model/litmus-tests/MP+polockmbonce+poacquiresilsil.litmus index 153917ad5dc9..ba91cc63e148 100644 --- a/tools/memory-model/litmus-tests/MP+polockmbonce+poacquiresilsil.litmus +++ b/tools/memory-model/litmus-tests/MP+polockmbonce+poacquiresilsil.litmus @@ -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 { diff --git a/tools/memory-model/litmus-tests/MP+polockonce+poacquiresilsil.litmus b/tools/memory-model/litmus-tests/MP+polockonce+poacquiresilsil.litmus index aad64397bb8c..a5ea3ed8f52e 100644 --- a/tools/memory-model/litmus-tests/MP+polockonce+poacquiresilsil.litmus +++ b/tools/memory-model/litmus-tests/MP+polockonce+poacquiresilsil.litmus @@ -10,10 +10,7 @@ C MP+polockonce+poacquiresilsil * speaking). *) -{ - spinlock_t lo; - int x; -} +{} P0(spinlock_t *lo, int *x) // Producer { diff --git a/tools/memory-model/litmus-tests/MP+polocks.litmus b/tools/memory-model/litmus-tests/MP+polocks.litmus index 21cbca6f3be4..e6af05f70069 100644 --- a/tools/memory-model/litmus-tests/MP+polocks.litmus +++ b/tools/memory-model/litmus-tests/MP+polocks.litmus @@ -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 { diff --git a/tools/memory-model/litmus-tests/MP+poonceonces.litmus b/tools/memory-model/litmus-tests/MP+poonceonces.litmus index 9f9769d647c7..ba9c99c6cf65 100644 --- a/tools/memory-model/litmus-tests/MP+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/MP+poonceonces.litmus @@ -7,10 +7,7 @@ C MP+poonceonces * no ordering at all? *) -{ - int buf; - int flag; -} +{} P0(int *buf, int *flag) // Producer { diff --git a/tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus b/tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus index cbe28e733443..f174bfe61702 100644 --- a/tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus +++ b/tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus @@ -8,10 +8,7 @@ C MP+pooncerelease+poacquireonce * pattern. *) -{ - int buf; - int flag; -} +{} P0(int *buf, int *flag) // Producer { diff --git a/tools/memory-model/litmus-tests/MP+porevlocks.litmus b/tools/memory-model/litmus-tests/MP+porevlocks.litmus index 012041bd4feb..b9599141160e 100644 --- a/tools/memory-model/litmus-tests/MP+porevlocks.litmus +++ b/tools/memory-model/litmus-tests/MP+porevlocks.litmus @@ -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 { diff --git a/tools/memory-model/litmus-tests/R+fencembonceonces.litmus b/tools/memory-model/litmus-tests/R+fencembonceonces.litmus index af9463b39b4a..222a0b850b4a 100644 --- a/tools/memory-model/litmus-tests/R+fencembonceonces.litmus +++ b/tools/memory-model/litmus-tests/R+fencembonceonces.litmus @@ -9,10 +9,7 @@ C R+fencembonceonces * cause the resulting test to be allowed. *) -{ - int x; - int y; -} +{} P0(int *x, int *y) { diff --git a/tools/memory-model/litmus-tests/R+poonceonces.litmus b/tools/memory-model/litmus-tests/R+poonceonces.litmus index bcd5574e304a..5386f128a131 100644 --- a/tools/memory-model/litmus-tests/R+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/R+poonceonces.litmus @@ -8,10 +8,7 @@ C R+poonceonces * store propagation delays. *) -{ - int x; - int y; -} +{} P0(int *x, int *y) { diff --git a/tools/memory-model/litmus-tests/S+fencewmbonceonce+poacquireonce.litmus b/tools/memory-model/litmus-tests/S+fencewmbonceonce+poacquireonce.litmus index c36341d1aed6..18479823cd6c 100644 --- a/tools/memory-model/litmus-tests/S+fencewmbonceonce+poacquireonce.litmus +++ b/tools/memory-model/litmus-tests/S+fencewmbonceonce+poacquireonce.litmus @@ -7,10 +7,7 @@ C S+fencewmbonceonce+poacquireonce * store against a subsequent store? *) -{ - int x; - int y; -} +{} P0(int *x, int *y) { diff --git a/tools/memory-model/litmus-tests/S+poonceonces.litmus b/tools/memory-model/litmus-tests/S+poonceonces.litmus index 7775c23143a0..8c9c2f81a580 100644 --- a/tools/memory-model/litmus-tests/S+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/S+poonceonces.litmus @@ -9,10 +9,7 @@ C S+poonceonces * READ_ONCE(), is ordering preserved? *) -{ - int x; - int y; -} +{} P0(int *x, int *y) { diff --git a/tools/memory-model/litmus-tests/SB+fencembonceonces.litmus b/tools/memory-model/litmus-tests/SB+fencembonceonces.litmus index 833cdfeb7c09..ed5fff18d223 100644 --- a/tools/memory-model/litmus-tests/SB+fencembonceonces.litmus +++ b/tools/memory-model/litmus-tests/SB+fencembonceonces.litmus @@ -9,10 +9,7 @@ C SB+fencembonceonces * suffice, but not much else.) *) -{ - int x; - int y; -} +{} P0(int *x, int *y) { diff --git a/tools/memory-model/litmus-tests/SB+poonceonces.litmus b/tools/memory-model/litmus-tests/SB+poonceonces.litmus index c92211ecbfdf..10d550730b25 100644 --- a/tools/memory-model/litmus-tests/SB+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/SB+poonceonces.litmus @@ -8,10 +8,7 @@ C SB+poonceonces * variable that the preceding process reads. *) -{ - int x; - int y; -} +{} P0(int *x, int *y) { diff --git a/tools/memory-model/litmus-tests/SB+rfionceonce-poonceonces.litmus b/tools/memory-model/litmus-tests/SB+rfionceonce-poonceonces.litmus index 84344b455eb7..04a16603660b 100644 --- a/tools/memory-model/litmus-tests/SB+rfionceonce-poonceonces.litmus +++ b/tools/memory-model/litmus-tests/SB+rfionceonce-poonceonces.litmus @@ -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) { diff --git a/tools/memory-model/litmus-tests/WRC+poonceonces+Once.litmus b/tools/memory-model/litmus-tests/WRC+poonceonces+Once.litmus index 431494708611..6a2bc12a1af1 100644 --- a/tools/memory-model/litmus-tests/WRC+poonceonces+Once.litmus +++ b/tools/memory-model/litmus-tests/WRC+poonceonces+Once.litmus @@ -8,10 +8,7 @@ C WRC+poonceonces+Once * test has no ordering at all. *) -{ - int x; - int y; -} +{} P0(int *x) { diff --git a/tools/memory-model/litmus-tests/WRC+pooncerelease+fencermbonceonce+Once.litmus b/tools/memory-model/litmus-tests/WRC+pooncerelease+fencermbonceonce+Once.litmus index 554999c64db5..e9947250d7de 100644 --- a/tools/memory-model/litmus-tests/WRC+pooncerelease+fencermbonceonce+Once.litmus +++ b/tools/memory-model/litmus-tests/WRC+pooncerelease+fencermbonceonce+Once.litmus @@ -10,10 +10,7 @@ C WRC+pooncerelease+fencermbonceonce+Once * is A-cumulative in LKMM. *) -{ - int x; - int y; -} +{} P0(int *x) { diff --git a/tools/memory-model/litmus-tests/Z6.0+pooncelock+poonceLock+pombonce.litmus b/tools/memory-model/litmus-tests/Z6.0+pooncelock+poonceLock+pombonce.litmus index 265a95ffef13..415248fb6699 100644 --- a/tools/memory-model/litmus-tests/Z6.0+pooncelock+poonceLock+pombonce.litmus +++ b/tools/memory-model/litmus-tests/Z6.0+pooncelock+poonceLock+pombonce.litmus @@ -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) { diff --git a/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus b/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus index 0c9aea8e80df..10a2aa04cd07 100644 --- a/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus +++ b/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus @@ -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) { diff --git a/tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus b/tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus index 661f9aaa5791..88e70b87a683 100644 --- a/tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus +++ b/tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus @@ -14,11 +14,7 @@ C Z6.0+pooncerelease+poacquirerelease+fencembonceonce * involving locking.) *) -{ - int x; - int y; - int z; -} +{} P0(int *x, int *y) { -- 2.17.1