diff options
28 files changed, 246 insertions, 1 deletions
diff --git a/tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus b/tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus index 5b83d57f6ac5..967f9f2a6226 100644 --- a/tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus +++ b/tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus | |||
@@ -1,5 +1,12 @@ | |||
1 | C CoRR+poonceonce+Once | 1 | C CoRR+poonceonce+Once |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * Test of read-read coherence, that is, whether or not two successive | ||
7 | * reads from the same variable are ordered. | ||
8 | *) | ||
9 | |||
3 | {} | 10 | {} |
4 | 11 | ||
5 | P0(int *x) | 12 | 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 fab91c13d52c..4635739f3974 100644 --- a/tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus +++ b/tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus | |||
@@ -1,5 +1,12 @@ | |||
1 | C CoRW+poonceonce+Once | 1 | C CoRW+poonceonce+Once |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * Test of read-write coherence, that is, whether or not a read from | ||
7 | * a given variable and a later write to that same variable are ordered. | ||
8 | *) | ||
9 | |||
3 | {} | 10 | {} |
4 | 11 | ||
5 | P0(int *x) | 12 | 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 6a35ec2042ea..bb068c92d8da 100644 --- a/tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus +++ b/tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus | |||
@@ -1,5 +1,12 @@ | |||
1 | C CoWR+poonceonce+Once | 1 | C CoWR+poonceonce+Once |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * Test of write-read coherence, that is, whether or not a write to a | ||
7 | * given variable and a later read from that same variable are ordered. | ||
8 | *) | ||
9 | |||
3 | {} | 10 | {} |
4 | 11 | ||
5 | P0(int *x) | 12 | P0(int *x) |
diff --git a/tools/memory-model/litmus-tests/CoWW+poonceonce.litmus b/tools/memory-model/litmus-tests/CoWW+poonceonce.litmus index 32a96b832021..0d9f0a958799 100644 --- a/tools/memory-model/litmus-tests/CoWW+poonceonce.litmus +++ b/tools/memory-model/litmus-tests/CoWW+poonceonce.litmus | |||
@@ -1,5 +1,12 @@ | |||
1 | C CoWW+poonceonce | 1 | C CoWW+poonceonce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * Test of write-write coherence, that is, whether or not two successive | ||
7 | * writes to the same variable are ordered. | ||
8 | *) | ||
9 | |||
3 | {} | 10 | {} |
4 | 11 | ||
5 | P0(int *x) | 12 | P0(int *x) |
diff --git a/tools/memory-model/litmus-tests/IRIW+mbonceonces+OnceOnce.litmus b/tools/memory-model/litmus-tests/IRIW+mbonceonces+OnceOnce.litmus index 7eba2c68992b..50d5db9ea983 100644 --- a/tools/memory-model/litmus-tests/IRIW+mbonceonces+OnceOnce.litmus +++ b/tools/memory-model/litmus-tests/IRIW+mbonceonces+OnceOnce.litmus | |||
@@ -1,5 +1,15 @@ | |||
1 | C IRIW+mbonceonces+OnceOnce | 1 | C IRIW+mbonceonces+OnceOnce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * Test of independent reads from independent writes with smp_mb() | ||
7 | * between each pairs of reads. In other words, is smp_mb() sufficient to | ||
8 | * cause two different reading processes to agree on the order of a pair | ||
9 | * of writes, where each write is to a different variable by a different | ||
10 | * process? | ||
11 | *) | ||
12 | |||
3 | {} | 13 | {} |
4 | 14 | ||
5 | P0(int *x) | 15 | 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 b0556c6c75d4..4b54dd6a6cd9 100644 --- a/tools/memory-model/litmus-tests/IRIW+poonceonces+OnceOnce.litmus +++ b/tools/memory-model/litmus-tests/IRIW+poonceonces+OnceOnce.litmus | |||
@@ -1,5 +1,15 @@ | |||
1 | C IRIW+poonceonces+OnceOnce | 1 | C IRIW+poonceonces+OnceOnce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Sometimes | ||
5 | * | ||
6 | * Test of independent reads from independent writes with nothing | ||
7 | * between each pairs of reads. In other words, is anything at all | ||
8 | * needed to cause two different reading processes to agree on the order | ||
9 | * of a pair of writes, where each write is to a different variable by a | ||
10 | * different process? | ||
11 | *) | ||
12 | |||
3 | {} | 13 | {} |
4 | 14 | ||
5 | P0(int *x) | 15 | P0(int *x) |
diff --git a/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus b/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus index 9a1a233d70c3..b321aa6f4ea5 100644 --- a/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus | |||
@@ -1,5 +1,14 @@ | |||
1 | C ISA2+poonceonces | 1 | C ISA2+poonceonces |
2 | 2 | ||
3 | (* | ||
4 | * Result: Sometimes | ||
5 | * | ||
6 | * Given a release-acquire chain ordering the first process's store | ||
7 | * against the last process's load, is ordering preserved if all of the | ||
8 | * smp_store_release() invocations are replaced by WRITE_ONCE() and all | ||
9 | * of the smp_load_acquire() invocations are replaced by READ_ONCE()? | ||
10 | *) | ||
11 | |||
3 | {} | 12 | {} |
4 | 13 | ||
5 | P0(int *x, int *y) | 14 | 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 235195e87d4e..025b0462ec9b 100644 --- a/tools/memory-model/litmus-tests/ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus +++ b/tools/memory-model/litmus-tests/ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus | |||
@@ -1,5 +1,16 @@ | |||
1 | C ISA2+pooncerelease+poacquirerelease+poacquireonce | 1 | C ISA2+pooncerelease+poacquirerelease+poacquireonce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This litmus test demonstrates that a release-acquire chain suffices | ||
7 | * to order P0()'s initial write against P2()'s final read. The reason | ||
8 | * that the release-acquire chain suffices is because in all but one | ||
9 | * case (P2() to P0()), each process reads from the preceding process's | ||
10 | * write. In memory-model-speak, there is only one non-reads-from | ||
11 | * (AKA non-rf) link, so release-acquire is all that is needed. | ||
12 | *) | ||
13 | |||
3 | {} | 14 | {} |
4 | 15 | ||
5 | P0(int *x, int *y) | 16 | P0(int *x, int *y) |
diff --git a/tools/memory-model/litmus-tests/LB+ctrlonceonce+mbonceonce.litmus b/tools/memory-model/litmus-tests/LB+ctrlonceonce+mbonceonce.litmus index dd5ac3a8974a..de6708229dd1 100644 --- a/tools/memory-model/litmus-tests/LB+ctrlonceonce+mbonceonce.litmus +++ b/tools/memory-model/litmus-tests/LB+ctrlonceonce+mbonceonce.litmus | |||
@@ -1,5 +1,16 @@ | |||
1 | C LB+ctrlonceonce+mbonceonce | 1 | C LB+ctrlonceonce+mbonceonce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This litmus test demonstrates that lightweight ordering suffices for | ||
7 | * the load-buffering pattern, in other words, preventing all processes | ||
8 | * reading from the preceding process's write. In this example, the | ||
9 | * combination of a control dependency and a full memory barrier are enough | ||
10 | * to do the trick. (But the full memory barrier could be replaced with | ||
11 | * another control dependency and order would still be maintained.) | ||
12 | *) | ||
13 | |||
3 | {} | 14 | {} |
4 | 15 | ||
5 | P0(int *x, int *y) | 16 | 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 47bd61319d93..07b9904b0e49 100644 --- a/tools/memory-model/litmus-tests/LB+poacquireonce+pooncerelease.litmus +++ b/tools/memory-model/litmus-tests/LB+poacquireonce+pooncerelease.litmus | |||
@@ -1,5 +1,13 @@ | |||
1 | C LB+poacquireonce+pooncerelease | 1 | C LB+poacquireonce+pooncerelease |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * Does a release-acquire pair suffice for the load-buffering litmus | ||
7 | * test, where each process reads from one of two variables then writes | ||
8 | * to the other? | ||
9 | *) | ||
10 | |||
3 | {} | 11 | {} |
4 | 12 | ||
5 | P0(int *x, int *y) | 13 | 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 a5cdf027e34b..74c49cb3c37b 100644 --- a/tools/memory-model/litmus-tests/LB+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/LB+poonceonces.litmus | |||
@@ -1,5 +1,12 @@ | |||
1 | C LB+poonceonces | 1 | C LB+poonceonces |
2 | 2 | ||
3 | (* | ||
4 | * Result: Sometimes | ||
5 | * | ||
6 | * Can the counter-intuitive outcome for the load-buffering pattern | ||
7 | * be prevented even with no explicit ordering? | ||
8 | *) | ||
9 | |||
3 | {} | 10 | {} |
4 | 11 | ||
5 | P0(int *x, int *y) | 12 | P0(int *x, int *y) |
diff --git a/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus b/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus index 1a2fe5830381..97731b4bbdd8 100644 --- a/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus +++ b/tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus | |||
@@ -1,4 +1,13 @@ | |||
1 | C MP+onceassign+derefonce.litmus | 1 | C MP+onceassign+derefonce |
2 | |||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This litmus test demonstrates that rcu_assign_pointer() and | ||
7 | * rcu_dereference() suffice to ensure that an RCU reader will not see | ||
8 | * pre-initialization garbage when it traverses an RCU-protected data | ||
9 | * structure containing a newly inserted element. | ||
10 | *) | ||
2 | 11 | ||
3 | { | 12 | { |
4 | y=z; | 13 | y=z; |
diff --git a/tools/memory-model/litmus-tests/MP+polocks.litmus b/tools/memory-model/litmus-tests/MP+polocks.litmus index 5fe6f1e3c452..712a4fcdf6ce 100644 --- a/tools/memory-model/litmus-tests/MP+polocks.litmus +++ b/tools/memory-model/litmus-tests/MP+polocks.litmus | |||
@@ -1,5 +1,16 @@ | |||
1 | C MP+polocks | 1 | C MP+polocks |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This litmus test demonstrates how lock acquisitions and releases can | ||
7 | * stand in for smp_load_acquire() and smp_store_release(), respectively. | ||
8 | * In other words, when holding a given lock (or indeed after releasing a | ||
9 | * given lock), a CPU is not only guaranteed to see the accesses that other | ||
10 | * CPUs made while previously holding that lock, it is also guaranteed | ||
11 | * to see all prior accesses by those other CPUs. | ||
12 | *) | ||
13 | |||
3 | {} | 14 | {} |
4 | 15 | ||
5 | P0(int *x, int *y, spinlock_t *mylock) | 16 | P0(int *x, int *y, spinlock_t *mylock) |
diff --git a/tools/memory-model/litmus-tests/MP+poonceonces.litmus b/tools/memory-model/litmus-tests/MP+poonceonces.litmus index 46e1ac7ba126..b2b60b84fb9d 100644 --- a/tools/memory-model/litmus-tests/MP+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/MP+poonceonces.litmus | |||
@@ -1,5 +1,12 @@ | |||
1 | C MP+poonceonces | 1 | C MP+poonceonces |
2 | 2 | ||
3 | (* | ||
4 | * Result: Maybe | ||
5 | * | ||
6 | * Can the counter-intuitive message-passing outcome be prevented with | ||
7 | * no ordering at all? | ||
8 | *) | ||
9 | |||
3 | {} | 10 | {} |
4 | 11 | ||
5 | P0(int *x, int *y) | 12 | P0(int *x, int *y) |
diff --git a/tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus b/tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus index 0b00cc7293ba..d52c68429722 100644 --- a/tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus +++ b/tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus | |||
@@ -1,5 +1,13 @@ | |||
1 | C MP+pooncerelease+poacquireonce | 1 | C MP+pooncerelease+poacquireonce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This litmus test demonstrates that smp_store_release() and | ||
7 | * smp_load_acquire() provide sufficient ordering for the message-passing | ||
8 | * pattern. | ||
9 | *) | ||
10 | |||
3 | {} | 11 | {} |
4 | 12 | ||
5 | P0(int *x, int *y) | 13 | P0(int *x, int *y) |
diff --git a/tools/memory-model/litmus-tests/MP+porevlocks.litmus b/tools/memory-model/litmus-tests/MP+porevlocks.litmus index 90d011c34f33..72c9276b363e 100644 --- a/tools/memory-model/litmus-tests/MP+porevlocks.litmus +++ b/tools/memory-model/litmus-tests/MP+porevlocks.litmus | |||
@@ -1,5 +1,16 @@ | |||
1 | C MP+porevlocks | 1 | C MP+porevlocks |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This litmus test demonstrates how lock acquisitions and releases can | ||
7 | * stand in for smp_load_acquire() and smp_store_release(), respectively. | ||
8 | * In other words, when holding a given lock (or indeed after releasing a | ||
9 | * given lock), a CPU is not only guaranteed to see the accesses that other | ||
10 | * CPUs made while previously holding that lock, it is also guaranteed to | ||
11 | * see all prior accesses by those other CPUs. | ||
12 | *) | ||
13 | |||
3 | {} | 14 | {} |
4 | 15 | ||
5 | P0(int *x, int *y, spinlock_t *mylock) | 16 | P0(int *x, int *y, spinlock_t *mylock) |
diff --git a/tools/memory-model/litmus-tests/MP+wmbonceonce+rmbonceonce.litmus b/tools/memory-model/litmus-tests/MP+wmbonceonce+rmbonceonce.litmus index 604ad41ea0c2..c078f38ff27a 100644 --- a/tools/memory-model/litmus-tests/MP+wmbonceonce+rmbonceonce.litmus +++ b/tools/memory-model/litmus-tests/MP+wmbonceonce+rmbonceonce.litmus | |||
@@ -1,5 +1,13 @@ | |||
1 | C MP+wmbonceonce+rmbonceonce | 1 | C MP+wmbonceonce+rmbonceonce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This litmus test demonstrates that smp_wmb() and smp_rmb() provide | ||
7 | * sufficient ordering for the message-passing pattern. However, it | ||
8 | * is usually better to use smp_store_release() and smp_load_acquire(). | ||
9 | *) | ||
10 | |||
3 | {} | 11 | {} |
4 | 12 | ||
5 | P0(int *x, int *y) | 13 | P0(int *x, int *y) |
diff --git a/tools/memory-model/litmus-tests/R+mbonceonces.litmus b/tools/memory-model/litmus-tests/R+mbonceonces.litmus index e69b9e3e9436..a0e884ad2132 100644 --- a/tools/memory-model/litmus-tests/R+mbonceonces.litmus +++ b/tools/memory-model/litmus-tests/R+mbonceonces.litmus | |||
@@ -1,5 +1,14 @@ | |||
1 | C R+mbonceonces | 1 | C R+mbonceonces |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This is the fully ordered (via smp_mb()) version of one of the classic | ||
7 | * counterintuitive litmus tests that illustrates the effects of store | ||
8 | * propagation delays. Note that weakening either of the barriers would | ||
9 | * cause the resulting test to be allowed. | ||
10 | *) | ||
11 | |||
3 | {} | 12 | {} |
4 | 13 | ||
5 | P0(int *x, int *y) | 14 | 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 f7a12e00f82d..5386f128a131 100644 --- a/tools/memory-model/litmus-tests/R+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/R+poonceonces.litmus | |||
@@ -1,5 +1,13 @@ | |||
1 | C R+poonceonces | 1 | C R+poonceonces |
2 | 2 | ||
3 | (* | ||
4 | * Result: Sometimes | ||
5 | * | ||
6 | * This is the unordered (thus lacking smp_mb()) version of one of the | ||
7 | * classic counterintuitive litmus tests that illustrates the effects of | ||
8 | * store propagation delays. | ||
9 | *) | ||
10 | |||
3 | {} | 11 | {} |
4 | 12 | ||
5 | P0(int *x, int *y) | 13 | 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 d0d541c8ec7d..8c9c2f81a580 100644 --- a/tools/memory-model/litmus-tests/S+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/S+poonceonces.litmus | |||
@@ -1,5 +1,14 @@ | |||
1 | C S+poonceonces | 1 | C S+poonceonces |
2 | 2 | ||
3 | (* | ||
4 | * Result: Sometimes | ||
5 | * | ||
6 | * Starting with a two-process release-acquire chain ordering P0()'s | ||
7 | * first store against P1()'s final load, if the smp_store_release() | ||
8 | * is replaced by WRITE_ONCE() and the smp_load_acquire() replaced by | ||
9 | * READ_ONCE(), is ordering preserved? | ||
10 | *) | ||
11 | |||
3 | {} | 12 | {} |
4 | 13 | ||
5 | P0(int *x, int *y) | 14 | P0(int *x, int *y) |
diff --git a/tools/memory-model/litmus-tests/S+wmbonceonce+poacquireonce.litmus b/tools/memory-model/litmus-tests/S+wmbonceonce+poacquireonce.litmus index 1d292d0d6603..c53350205d28 100644 --- a/tools/memory-model/litmus-tests/S+wmbonceonce+poacquireonce.litmus +++ b/tools/memory-model/litmus-tests/S+wmbonceonce+poacquireonce.litmus | |||
@@ -1,5 +1,12 @@ | |||
1 | C S+wmbonceonce+poacquireonce | 1 | C S+wmbonceonce+poacquireonce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * Can a smp_wmb(), instead of a release, and an acquire order a prior | ||
7 | * store against a subsequent store? | ||
8 | *) | ||
9 | |||
3 | {} | 10 | {} |
4 | 11 | ||
5 | P0(int *x, int *y) | 12 | P0(int *x, int *y) |
diff --git a/tools/memory-model/litmus-tests/SB+mbonceonces.litmus b/tools/memory-model/litmus-tests/SB+mbonceonces.litmus index b76caa5af1af..74b874ffa8da 100644 --- a/tools/memory-model/litmus-tests/SB+mbonceonces.litmus +++ b/tools/memory-model/litmus-tests/SB+mbonceonces.litmus | |||
@@ -1,5 +1,14 @@ | |||
1 | C SB+mbonceonces | 1 | C SB+mbonceonces |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This litmus test demonstrates that full memory barriers suffice to | ||
7 | * order the store-buffering pattern, where each process writes to the | ||
8 | * variable that the preceding process reads. (Locking and RCU can also | ||
9 | * suffice, but not much else.) | ||
10 | *) | ||
11 | |||
3 | {} | 12 | {} |
4 | 13 | ||
5 | P0(int *x, int *y) | 14 | 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 c1797e03807e..10d550730b25 100644 --- a/tools/memory-model/litmus-tests/SB+poonceonces.litmus +++ b/tools/memory-model/litmus-tests/SB+poonceonces.litmus | |||
@@ -1,5 +1,13 @@ | |||
1 | C SB+poonceonces | 1 | C SB+poonceonces |
2 | 2 | ||
3 | (* | ||
4 | * Result: Sometimes | ||
5 | * | ||
6 | * This litmus test demonstrates that at least some ordering is required | ||
7 | * to order the store-buffering pattern, where each process writes to the | ||
8 | * variable that the preceding process reads. | ||
9 | *) | ||
10 | |||
3 | {} | 11 | {} |
4 | 12 | ||
5 | P0(int *x, int *y) | 13 | 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 f5e7c92f61cc..6a2bc12a1af1 100644 --- a/tools/memory-model/litmus-tests/WRC+poonceonces+Once.litmus +++ b/tools/memory-model/litmus-tests/WRC+poonceonces+Once.litmus | |||
@@ -1,5 +1,13 @@ | |||
1 | C WRC+poonceonces+Once | 1 | C WRC+poonceonces+Once |
2 | 2 | ||
3 | (* | ||
4 | * Result: Sometimes | ||
5 | * | ||
6 | * This litmus test is an extension of the message-passing pattern, | ||
7 | * where the first write is moved to a separate process. Note that this | ||
8 | * test has no ordering at all. | ||
9 | *) | ||
10 | |||
3 | {} | 11 | {} |
4 | 12 | ||
5 | P0(int *x) | 13 | P0(int *x) |
diff --git a/tools/memory-model/litmus-tests/WRC+pooncerelease+rmbonceonce+Once.litmus b/tools/memory-model/litmus-tests/WRC+pooncerelease+rmbonceonce+Once.litmus index e3d0018025dd..97fcbffde9a0 100644 --- a/tools/memory-model/litmus-tests/WRC+pooncerelease+rmbonceonce+Once.litmus +++ b/tools/memory-model/litmus-tests/WRC+pooncerelease+rmbonceonce+Once.litmus | |||
@@ -1,5 +1,13 @@ | |||
1 | C WRC+pooncerelease+rmbonceonce+Once | 1 | C WRC+pooncerelease+rmbonceonce+Once |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This litmus test is an extension of the message-passing pattern, where | ||
7 | * the first write is moved to a separate process. Because it features | ||
8 | * a release and a read memory barrier, it should be forbidden. | ||
9 | *) | ||
10 | |||
3 | {} | 11 | {} |
4 | 12 | ||
5 | P0(int *x) | 13 | 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 9c2cb53e6ef0..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 | |||
@@ -1,5 +1,14 @@ | |||
1 | C Z6.0+pooncelock+poonceLock+pombonce | 1 | C Z6.0+pooncelock+poonceLock+pombonce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Never | ||
5 | * | ||
6 | * This litmus test demonstrates how smp_mb__after_spinlock() may be | ||
7 | * used to ensure that accesses in different critical sections for a | ||
8 | * given lock running on different CPUs are nevertheless seen in order | ||
9 | * by CPUs not holding that lock. | ||
10 | *) | ||
11 | |||
3 | {} | 12 | {} |
4 | 13 | ||
5 | P0(int *x, int *y, spinlock_t *mylock) | 14 | 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 c9a1f1a49ae1..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 | |||
@@ -1,5 +1,13 @@ | |||
1 | C Z6.0+pooncelock+pooncelock+pombonce | 1 | C Z6.0+pooncelock+pooncelock+pombonce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Sometimes | ||
5 | * | ||
6 | * This example demonstrates that a pair of accesses made by different | ||
7 | * processes each while holding a given lock will not necessarily be | ||
8 | * seen as ordered by a third process not holding that lock. | ||
9 | *) | ||
10 | |||
3 | {} | 11 | {} |
4 | 12 | ||
5 | P0(int *x, int *y, spinlock_t *mylock) | 13 | P0(int *x, int *y, spinlock_t *mylock) |
diff --git a/tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+mbonceonce.litmus b/tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+mbonceonce.litmus index 25409a033514..a20fc3fafb53 100644 --- a/tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+mbonceonce.litmus +++ b/tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+mbonceonce.litmus | |||
@@ -1,5 +1,19 @@ | |||
1 | C Z6.0+pooncerelease+poacquirerelease+mbonceonce | 1 | C Z6.0+pooncerelease+poacquirerelease+mbonceonce |
2 | 2 | ||
3 | (* | ||
4 | * Result: Sometimes | ||
5 | * | ||
6 | * This litmus test shows that a release-acquire chain, while sufficient | ||
7 | * when there is but one non-reads-from (AKA non-rf) link, does not suffice | ||
8 | * if there is more than one. Of the three processes, only P1() reads from | ||
9 | * P0's write, which means that there are two non-rf links: P1() to P2() | ||
10 | * is a write-to-write link (AKA a "coherence" or just "co" link) and P2() | ||
11 | * to P0() is a read-to-write link (AKA a "from-reads" or just "fr" link). | ||
12 | * When there are two or more non-rf links, you typically will need one | ||
13 | * full barrier for each non-rf link. (Exceptions include some cases | ||
14 | * involving locking.) | ||
15 | *) | ||
16 | |||
3 | {} | 17 | {} |
4 | 18 | ||
5 | P0(int *x, int *y) | 19 | P0(int *x, int *y) |