Skip to contentSkip to conversation

CodeSamples/formal: Cleanup of init blocks in litmus tests

PATCH Applied Akira Yokosawa 2 participants 10 messages Nov 14, 2020 – Nov 22, 2020

lore
Share & tools
lore
#0 lore raw

cover CodeSamples/formal: Cleanup of init blocks in litmus tests

Hi Paul,

This patch set is what I mentioned the other day in response to your LKMM patch for 5.11.
klitmus7 doesn't need most of type info in litmus-test init blocks.

While there are some cases where klitmus7 requires type info of variables to be watched (via the "exists", "locations", or "filter" directive), as long as the watched variables are of type "int", extra type info in the init block is not required.

Litmus tests under CodeSamples/formal/ should keep compatible with klitmus7 after this patch set is applied.

Patch 1/2 removes initialization to 0 and type info of "int" or "int *" under CodeSamples/formal/litmus/.

Patch 2/2 further reduce line counts of litmus tests by using "{}" as empty init blocks.
It also adds/removes empty lines for those code snippets to have consistent looks.

Similar changes to patch 1/2 can be made in the RCU litmus tests presented in Section 12.3.2. They are not touched in this patch set.

May be in a follow-up patch.

Thanks, Akira

*NOTE*:

There are cases where litmus tests for herd7 can not be made compatible with (current) klitmus7, though.

One such example is when a variable of a type other than the "int" or "int *" (such as "spinlock_t") is specified in the "locations" or "filter" directive.
Current klitmus7 has no idea of the way to obtain the value of such a variable.

As for herd7, all the variables are treated as if they were "int" or "int *" regardless of the type specified in the litmus tests, there is no such problem.

--
Akira Yokosawa (2):
CodeSamples/formal/litmus: Remove redundant initializations CodeSamples/formal: Use '{}' for empty init blocks in litmus tests

 CodeSamples/formal/herd/C-LB+o-rl-rul-o+o-rl-rul-o.litmus | 5 ++---
 CodeSamples/formal/herd/C-LB+rl-o-o-rul+rl-o-o-rul.litmus | 5 ++---
 CodeSamples/formal/herd/C-Lock1.litmus                    | 5 +++--
 CodeSamples/formal/herd/C-Lock2.litmus                    | 5 +++--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus | 3 +--
 ...C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus | 3 +--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus | 3 +--
 ...C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus | 3 +--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus    | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus    | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus      | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus     | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus    | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus     | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus    | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u.litmus       | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-C.litmus     | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-CE.litmus    | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-X.litmus     | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-XE.litmus    | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u.litmus       | 3 +--
 .../formal/herd/C-SB+o-rcusync-o+i-rl-o-o-rul.litmus      | 5 ++---
 CodeSamples/formal/herd/C-SB+o-rcusync-o+o-o.litmus       | 5 ++---
 ...B+o-rcusync-o+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus | 7 ++-----
 .../formal/herd/C-SB+o-rcusync-o+o-rcusync-o.litmus       | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+o-rl-o-rul.litmus        | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+o-rl-rul-o.litmus        | 5 ++---
 .../herd/C-SB+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus    | 6 ++----
 .../formal/herd/C-SB+o-rcusync-o+rl-o-o-rul.litmus        | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+rl-o-rul-o.litmus        | 5 ++---
 CodeSamples/formal/litmus/C-2+2W+o-o+o-o.litmus           | 5 ++---
 CodeSamples/formal/litmus/C-2+2W+o-wmb-o+o-wmb-o.litmus   | 5 ++---
 CodeSamples/formal/litmus/C-CCIRIW+o+o+o-o+o-o.litmus     | 5 ++---
 CodeSamples/formal/litmus/C-ISA2+o-r+a-r+a-r+a-o.litmus   | 5 ++---
 .../formal/litmus/C-LB+a-o+o-data-o+o-data-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-LB+a-r+a-r+a-r+a-r.litmus     | 5 ++---
 .../formal/litmus/C-LB+cmpxchg-ctrl-o+o-ctrl-o.litmus     | 4 ++--
 .../formal/litmus/C-LB+o-cge-o+o-cge-o+dstb.litmus        | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-cge-o+o-cge-o.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-cgt-o+o-cgt-o.litmus     | 4 ++--
 .../formal/litmus/C-LB+o-data-o+o-data-o+o-data-o.litmus  | 7 +++----
 CodeSamples/formal/litmus/C-LB+o-o+o-o.litmus             | 5 ++---
 CodeSamples/formal/litmus/C-LB+o-r+a-o.litmus             | 5 ++---
 CodeSamples/formal/litmus/C-LB+o-r+o-ctrl-o.litmus        | 6 +++---
 CodeSamples/formal/litmus/C-LB+o-r+o-data-o.litmus        | 5 ++---
 CodeSamples/formal/litmus/C-MP+o-o+o-rmb-o.litmus         | 8 ++------
 CodeSamples/formal/litmus/C-MP+o-r+o-ctrl-o.litmus        | 7 ++-----
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-addr-o.litmus    | 8 ++------
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-o.litmus         | 7 +------
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-rmb-o.litmus     | 7 +------
 CodeSamples/formal/litmus/C-MP-OMCA+o-o-o+o-rmb-o.litmus  | 4 ++--
 CodeSamples/formal/litmus/C-R+o-wmb-o+o-mb-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-S+o-wmb-o+o-addr-o.litmus     | 8 ++------
 CodeSamples/formal/litmus/C-SB+o-mb-o+o-mb-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-SB+o-o+o-o.litmus             | 6 +++---
 .../formal/litmus/C-SB-OMCA+o-o-rmb-o+o-o-rmb-o.litmus    | 4 +---
 .../formal/litmus/C-W+RWC+o-mb-o+a-o+o-mb-o.litmus        | 6 +-----
 CodeSamples/formal/litmus/C-W+RWC+o-r+a-o+o-mb-o.litmus   | 6 +-----
 CodeSamples/formal/litmus/C-WRC+o+o-data-o+o-rmb-o.litmus | 4 ++--
 CodeSamples/formal/litmus/C-WRC+o+o-r+a-o.litmus          | 3 +--
 .../formal/litmus/C-WWC+o+o-data-o+o-addr-o.litmus        | 6 ++----
 CodeSamples/formal/litmus/C-WWC+o+o-r+o-addr-o.litmus     | 6 ++----
 .../formal/litmus/C-WWC+o-cge-o+o-cge-o+o+dstb.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-WWC+o-cge-o+o-cge-o+o.litmus  | 4 ++--
 .../formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o+dstb.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o.litmus  | 4 ++--
 CodeSamples/formal/litmus/C-Z6.2+o-r+a-o+o-mb-o.litmus    | 6 +-----
 CodeSamples/formal/litmus/C-Z6.2+o-r+a-r+a-r+a-o.litmus   | 5 ++---
 CodeSamples/formal/litmus/C-cmpxchg.litmus                | 4 ++--
 memorder/memorder.tex                                     | 8 ++------
 73 files changed, 124 insertions(+), 217 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 CodeSamples/formal/litmus: Remove redundant initialization

From 40b6085963f79b50b2d326cad2b37692a7e89880 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 8 Nov 2020 07:33:29 +0900
Subject: [PATCH perfbook 1/2] CodeSamples/formal/litmus: Remove redundant initialization

In C Flavor litmus tests, global variables of type "int" need initialization only when they aren't 0.
This is true not only for herd7 but also for klitmus7/litmus7.

Declaration of plain "int" or "int *" can also be removed.

We can also remove "&" in the right hand side of initialization.

Finally, to reduce line counts of snippets, use "{}" when init blocks are empty.

For consistency, put an empty line above initialization blocks and remove extra blank lines in other parts of litmus tests.

---
 CodeSamples/formal/litmus/C-CCIRIW+o+o+o-o+o-o.litmus     | 5 ++---
 .../formal/litmus/C-LB+o-data-o+o-data-o+o-data-o.litmus  | 7 +++----
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-addr-o.litmus    | 4 ++--
 CodeSamples/formal/litmus/C-S+o-wmb-o+o-addr-o.litmus     | 4 ++--
 .../formal/litmus/C-W+RWC+o-mb-o+a-o+o-mb-o.litmus        | 6 +-----
 CodeSamples/formal/litmus/C-W+RWC+o-r+a-o+o-mb-o.litmus   | 6 +-----
 .../formal/litmus/C-WWC+o+o-data-o+o-addr-o.litmus        | 6 ++----
 CodeSamples/formal/litmus/C-WWC+o+o-r+o-addr-o.litmus     | 6 ++----
 CodeSamples/formal/litmus/C-Z6.2+o-r+a-o+o-mb-o.litmus    | 6 +-----
 memorder/memorder.tex                                     | 8 ++------
 10 files changed, 18 insertions(+), 40 deletions(-)
CodeSamples/formal/litmus/C-CCIRIW+o+o+o-o+o-o.litmus +2 -3
index 833dc9cf..017c782b 100644
@@ -1,8 +1,7 @@
 C C-CCIRIW+o+o+o-o+o-o
 //\begin[snippet][labelbase=ln:formal:C-CCIRIW+o+o+o-o+o-o:whole,commandchars=\@\[\]]
-{
-int x = 0;
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
CodeSamples/formal/litmus/C-LB+o-data-o+o-data-o+o-data-o.litmus +3 -4
index 48bf94e3..aa1c3cd0 100644
@@ -1,9 +1,9 @@
 C C-LB+o-data-o+o-data-o+o-data-o
 //\begin[snippet][labelbase=ln:formal:C-LB+o-data-o+o-data-o+o-data-o:whole,commandchars=\@\[\]]
+
 {
-int x0=0;
-int x1=1;
-int x2=2;
+x1=1;
+x2=2;
 }
 
 {				//\fcvexclude
@@ -18,7 +18,6 @@ P0(int *x0, int *x1)
 	WRITE_ONCE(*x1, r2);
 }
 
-
 P1(int *x1, int *x2)
 {
 	int r2;
CodeSamples/formal/litmus/C-MP+o-wmb-o+o-addr-o.litmus +2 -2
index 63a86562..865943e5 100644
@@ -2,8 +2,8 @@ C C-MP+o-wmb-o+o-ad-o
 //\begin[snippet][][labelbase=ln:formal:C-MP+o-wmb-o+o-addr-o:whole,commandchars=\@\[\]]
 
 {
-int y=1;			(* \lnlbl[init:y] *)
-int *x1 = &y;			(* \lnlbl[init:x1] *)
+y=1;			(* \lnlbl[init:y] *)
+x1=y;			(* \lnlbl[init:x1] *)
 }
 
 {				//\fcvexclude
CodeSamples/formal/litmus/C-S+o-wmb-o+o-addr-o.litmus +2 -2
index e9b91e87..11171cd5 100644
@@ -2,8 +2,8 @@ C C-S+o-wmb-o+o-addr-o
 //\begin[snippet][labelbase=ln:formal:C-S+o-wmb-o+o-addr-o:whole,commandchars=\@\[\]]
 
 {
-int y=1;
-int *x1 = &y;
+y=1;
+x1=y;
 }
 
 {				//\fcvexclude
CodeSamples/formal/litmus/C-W+RWC+o-mb-o+a-o+o-mb-o.litmus +1 -5
index d664136b..a6d99b6f 100644
@@ -1,11 +1,7 @@
 C C-W+RWC+o-mb-o+a-o+o-mb-o
 //\begin[snippet][labelbase=ln:formal:C-W+RWC+o-mb-o+a-o+o-mb-o:whole,commandchars=\@\[\]]
 
-{
-int x = 0;
-int y = 0;
-int z = 0;
-}
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
CodeSamples/formal/litmus/C-W+RWC+o-r+a-o+o-mb-o.litmus +1 -5
index 17f300e1..53ae7bdc 100644
@@ -1,11 +1,7 @@
 C C-W+RWC+o-r+a-o+o-mb-o
 //\begin[snippet][labelbase=ln:formal:C-W+RWC+o-r+a-o+o-mb-o:whole,commandchars=\@\[\]]
 
-{
-int x = 0;
-int y = 0;
-int z = 0;
-}
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
CodeSamples/formal/litmus/C-WWC+o+o-data-o+o-addr-o.litmus +2 -4
index 3525e033..1310bd7f 100644
@@ -1,10 +1,8 @@
 C C-WWC+o+o-data-o+o-addr-o
 
 {
-int a = 0;
-int b = 0;
-int *x = &a;
-int *y = &b;
+x=a;
+y=b;
 }
 
 {
CodeSamples/formal/litmus/C-WWC+o+o-r+o-addr-o.litmus +2 -4
index 0d16b2f7..dbfc8044 100644
@@ -1,10 +1,8 @@
 C C-WWC+o+o-r+o-addr-o
 
 {
-int a = 0;
-int b = 0;
-int *x = &a;
-int *y = &b;
+x=a;
+y=b;
 }
 
 {
CodeSamples/formal/litmus/C-Z6.2+o-r+a-o+o-mb-o.litmus +1 -5
index 2115bcf1..747f777f 100644
@@ -1,11 +1,7 @@
 C C-Z6.2+o-r+a-o+o-mb-o
 //\begin[snippet][labelbase=ln:formal:C-Z6.2+o-r+a-o+o-mb-o:whole,commandchars=\@\[\]]
 
-{
-int x = 0;
-int y = 0;
-int z = 0;
-}
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
memorder/memorder.tex +2 -6
index 44e1d14d..5118241e 100644
@@ -1216,26 +1216,22 @@ Therefore, on older versions of Linux,
 C C-MP+o-wmb-o+ld-addr-o
 
 {
-int y=1;
-int *x1 = &y;
+y=1;
+x1=y;
 }
 
 P0(int* x0, int** x1) {
-
 	WRITE_ONCE(*x0, 2);
 	smp_wmb();
 	WRITE_ONCE(*x1, x0);
-
 }
 
 P1(int** x1) {
-
 	int *r2;
 	int r3;
 
 	r2 = lockless_dereference(*x1); // Obsolete @lnlbl[deref]
 	r3 = READ_ONCE(*r2);			    @lnlbl[read]
-
 }
 
 exists (1:r2=x0 /\ 1:r3=1)
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 CodeSamples/formal: Use '{}' for empty init blocks in litmus tests

In reply to Akira Yokosawa

From 7bd6d1eccdfd70b6d0ff1c04a080875215173615 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 8 Nov 2020 08:18:51 +0900
Subject: [PATCH perfbook 2/2] CodeSamples/formal: Use '{}' for empty init blocks in litmus tests

Also remove or add empty lines for consistency.

---
 CodeSamples/formal/herd/C-LB+o-rl-rul-o+o-rl-rul-o.litmus | 5 ++---
 CodeSamples/formal/herd/C-LB+rl-o-o-rul+rl-o-o-rul.litmus | 5 ++---
 CodeSamples/formal/herd/C-Lock1.litmus                    | 5 +++--
 CodeSamples/formal/herd/C-Lock2.litmus                    | 5 +++--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus | 3 +--
 ...C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus | 3 +--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus | 3 +--
 ...C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus | 3 +--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus    | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus    | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus      | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus     | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus    | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus     | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus    | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u.litmus       | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-C.litmus     | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-CE.litmus    | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-X.litmus     | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-XE.litmus    | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u.litmus       | 3 +--
 .../formal/herd/C-SB+o-rcusync-o+i-rl-o-o-rul.litmus      | 5 ++---
 CodeSamples/formal/herd/C-SB+o-rcusync-o+o-o.litmus       | 5 ++---
 ...B+o-rcusync-o+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus | 7 ++-----
 .../formal/herd/C-SB+o-rcusync-o+o-rcusync-o.litmus       | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+o-rl-o-rul.litmus        | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+o-rl-rul-o.litmus        | 5 ++---
 .../herd/C-SB+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus    | 6 ++----
 .../formal/herd/C-SB+o-rcusync-o+rl-o-o-rul.litmus        | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+rl-o-rul-o.litmus        | 5 ++---
 CodeSamples/formal/litmus/C-2+2W+o-o+o-o.litmus           | 5 ++---
 CodeSamples/formal/litmus/C-2+2W+o-wmb-o+o-wmb-o.litmus   | 5 ++---
 CodeSamples/formal/litmus/C-ISA2+o-r+a-r+a-r+a-o.litmus   | 5 ++---
 .../formal/litmus/C-LB+a-o+o-data-o+o-data-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-LB+a-r+a-r+a-r+a-r.litmus     | 5 ++---
 .../formal/litmus/C-LB+cmpxchg-ctrl-o+o-ctrl-o.litmus     | 4 ++--
 .../formal/litmus/C-LB+o-cge-o+o-cge-o+dstb.litmus        | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-cge-o+o-cge-o.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-cgt-o+o-cgt-o.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-o+o-o.litmus             | 5 ++---
 CodeSamples/formal/litmus/C-LB+o-r+a-o.litmus             | 5 ++---
 CodeSamples/formal/litmus/C-LB+o-r+o-ctrl-o.litmus        | 6 +++---
 CodeSamples/formal/litmus/C-LB+o-r+o-data-o.litmus        | 5 ++---
 CodeSamples/formal/litmus/C-MP+o-o+o-rmb-o.litmus         | 8 ++------
 CodeSamples/formal/litmus/C-MP+o-r+o-ctrl-o.litmus        | 7 ++-----
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-addr-o.litmus    | 4 ----
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-o.litmus         | 7 +------
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-rmb-o.litmus     | 7 +------
 CodeSamples/formal/litmus/C-MP-OMCA+o-o-o+o-rmb-o.litmus  | 4 ++--
 CodeSamples/formal/litmus/C-R+o-wmb-o+o-mb-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-S+o-wmb-o+o-addr-o.litmus     | 4 ----
 CodeSamples/formal/litmus/C-SB+o-mb-o+o-mb-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-SB+o-o+o-o.litmus             | 6 +++---
 .../formal/litmus/C-SB-OMCA+o-o-rmb-o+o-o-rmb-o.litmus    | 4 +---
 CodeSamples/formal/litmus/C-WRC+o+o-data-o+o-rmb-o.litmus | 4 ++--
 CodeSamples/formal/litmus/C-WRC+o+o-r+a-o.litmus          | 3 +--
 .../formal/litmus/C-WWC+o-cge-o+o-cge-o+o+dstb.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-WWC+o-cge-o+o-cge-o+o.litmus  | 4 ++--
 .../formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o+dstb.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o.litmus  | 4 ++--
 CodeSamples/formal/litmus/C-Z6.2+o-r+a-r+a-r+a-o.litmus   | 5 ++---
 CodeSamples/formal/litmus/C-cmpxchg.litmus                | 4 ++--
 65 files changed, 106 insertions(+), 177 deletions(-)
CodeSamples/formal/herd/C-LB+o-rl-rul-o+o-rl-rul-o.litmus +2 -3
index ba0b4799..bb2c94ef 100644
@@ -1,7 +1,7 @@
 C C-LB+o-rl-rul-o+o-rl-rul-o
 //\begin[snippet][labelbase=ln:formal:C-LB+o-rl-rul-o+o-rl-rul-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -11,7 +11,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	WRITE_ONCE(*x1, 1);
 }
 
-
 P1(uintptr_t *x0, uintptr_t *x1)
 {
 	uintptr_t r1 = READ_ONCE(*x1);
CodeSamples/formal/herd/C-LB+rl-o-o-rul+rl-o-o-rul.litmus +2 -3
index 8551ecaa..7ac2a2ab 100644
@@ -1,7 +1,7 @@
 C C-LB+rl-o-o-rul+rl-o-o-rul
 //\begin[snippet][labelbase=ln:formal:C-LB+rl-o-o-rul+rl-o-o-rul:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -11,7 +11,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	rcu_read_unlock();
 }
 
-
 P1(uintptr_t *x0, uintptr_t *x1)
 {
 	rcu_read_lock();
CodeSamples/formal/herd/C-Lock1.litmus +3 -2
index 5a1065d5..b66d83f4 100644
@@ -1,7 +1,7 @@
 C Lock1
 //\begin[snippet][labelbase=ln:formal:C-Lock1:whole,commandchars=\\\[\]]
-{
-}
+
+{}
 
 P0(int *x, spinlock_t *sp)
 {
@@ -19,5 +19,6 @@ P1(int *x, spinlock_t *sp)
 	r1 = READ_ONCE(*x);
 	spin_unlock(sp);
 }
+
 //\end[snippet]
 exists (1:r1=1)
CodeSamples/formal/herd/C-Lock2.litmus +3 -2
index dc28b24e..00210cb9 100644
@@ -1,7 +1,7 @@
 C Lock2
 //\begin[snippet][labelbase=ln:formal:C-Lock2:whole,commandchars=\\\[\]]
-{
-}
+
+{}
 
 P0(int *x, spinlock_t *sp1)
 {
@@ -19,5 +19,6 @@ P1(int *x, spinlock_t *sp2) // Buggy!
 	r1 = READ_ONCE(*x);
 	spin_unlock(sp2);
 }
+
 //\end[snippet]
 exists (1:r1=1)
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus +1 -2
index 7175ca89..f4ad486e 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus +1 -2
index 46fd9ad8..5ac9058b 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus +1 -2
index 3fdddbb2..cb989ab1 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus +1 -2
index a7f9ec55..d6dddac8 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus +1 -2
index fc2117e2..e19d6cc6 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u
 
-{
-}
+{}
 
 P0(spinlock_t *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus +1 -2
index f087f9cb..6bf22c64 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus +1 -2
index d9712c85..d9887d6d 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus +1 -2
index 22e8dd54..a075434c 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus +1 -2
index 17e640dc..7c9bca43 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus +1 -2
index 9208eaad..a1d4e965 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u
 
-{
-}
+{}
 
 P0(spinlock_t *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus +1 -2
index 19b70691..efe6925b 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u-C
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus +1 -2
index c22f6a45..376bf88f 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u-CE
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus +1 -2
index 98ded7ea..984a2c4d 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u-X
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus +1 -2
index 5f376fa2..59064811 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u-XE
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u.litmus +1 -2
index 90ea057f..7d5b881b 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u+l-o-o-u
 
-{
-}
+{}
 
 P0(spinlock_t *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-C.litmus +1 -2
index 3e9e0236..456a3055 100644
@@ -1,8 +1,7 @@
 C C-SB+l-o-o-u+l-o-o-u-C
 // \begin[snippet][labelbase=ln:future:formalregress:C-SB+l-o-o-u+l-o-o-u-C:whole,commandchars=\%\[\]]
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-CE.litmus +1 -2
index 1e2dd5be..c0703a49 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u-CE
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-X.litmus +1 -2
index 30a7fe71..5d19c0c7 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u-X
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-XE.litmus +1 -2
index 28a0f83b..3e9c461c 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u-XE
 
-{
-}
+{}
 
 P0(int *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u.litmus +1 -2
index c16d8f95..8307b389 100644
@@ -1,7 +1,6 @@
 C C-SB+l-o-o-u+l-o-o-u
 
-{
-}
+{}
 
 P0(spinlock_t *sl, int *x0, int *x1)
 {
CodeSamples/formal/herd/C-SB+o-rcusync-o+i-rl-o-o-rul.litmus +2 -3
index 1a9625e8..1a9de656 100644
@@ -1,7 +1,7 @@
 C C-SB+o-rcusync-o+i-rl-o-o-rul
 //\begin[snippet][labelbase=ln:formal:C-SB+o-rcusync-o+i-rl-o-o-rul:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -10,7 +10,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	uintptr_t r2 = READ_ONCE(*x1);
 }
 
-
 P1(uintptr_t *x0, uintptr_t *x1)
 {
 	rcu_read_lock();
CodeSamples/formal/herd/C-SB+o-rcusync-o+o-o.litmus +2 -3
index 8681c847..8ae8db2c 100644
@@ -1,7 +1,7 @@
 C C-SB+o-rcusync-o+o-o
 //\begin[snippet][labelbase=ln:formal:C-SB+o-rcusync-o+o-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -10,7 +10,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	uintptr_t r2 = READ_ONCE(*x1);
 }
 
-
 P1(uintptr_t *x0, uintptr_t *x1)
 {
 	WRITE_ONCE(*x1, 2);
CodeSamples/formal/herd/C-SB+o-rcusync-o+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus +2 -5
index 18595f4c..02bb51a7 100644
@@ -1,7 +1,7 @@
 C C-SB+o-rcusync-o+o-rcusync-o+rl-o-o-rul+rl-o-o-rul
 //\begin[snippet][labelbase=ln:formal:C-SB+o-rcusync-o+o-rcusync-o+rl-o-o-rul+rl-o-o-rul:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -10,7 +10,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	uintptr_t r2 = READ_ONCE(*x1);
 }
 
-
 P1(uintptr_t *x1, uintptr_t *x2)
 {
 	WRITE_ONCE(*x1, 2);
@@ -18,7 +17,6 @@ P1(uintptr_t *x1, uintptr_t *x2)
 	uintptr_t r2 = READ_ONCE(*x2);
 }
 
-
 P2(uintptr_t *x2, uintptr_t *x3)
 {
 	rcu_read_lock();
@@ -27,7 +25,6 @@ P2(uintptr_t *x2, uintptr_t *x3)
 	rcu_read_unlock();
 }
 
-
 P3(uintptr_t *x0, uintptr_t *x3)
 {
 	rcu_read_lock();
CodeSamples/formal/herd/C-SB+o-rcusync-o+o-rcusync-o.litmus +2 -3
index aa3a49fa..f48bf45e 100644
@@ -1,7 +1,7 @@
 C C-SB+o-rcusync-o+o-rcusync-o
 //\begin[snippet][labelbase=ln:formal:C-SB+o-rcusync-o+o-rcusync-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -10,7 +10,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	uintptr_t r2 = READ_ONCE(*x1);
 }
 
-
 P1(uintptr_t *x0, uintptr_t *x1)
 {
 	WRITE_ONCE(*x1, 2);
CodeSamples/formal/herd/C-SB+o-rcusync-o+o-rl-o-rul.litmus +2 -3
index 503dcf80..0542443e 100644
@@ -1,7 +1,7 @@
 C C-SB+o-rcusync-o+o-rl-o-rul
 //\begin[snippet][labelbase=ln:formal:C-SB+o-rcusync-o+o-rl-o-rul:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -10,7 +10,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	uintptr_t r2 = READ_ONCE(*x1);
 }
 
-
 P1(uintptr_t *x0, uintptr_t *x1)
 {
 	WRITE_ONCE(*x1, 2);
CodeSamples/formal/herd/C-SB+o-rcusync-o+o-rl-rul-o.litmus +2 -3
index 054e2e7a..69413916 100644
@@ -1,7 +1,7 @@
 C C-SB+o-rcusync-o+o-rl-rul-o
 //\begin[snippet][labelbase=ln:formal:C-SB+o-rcusync-o+o-rl-rul-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -10,7 +10,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	uintptr_t r2 = READ_ONCE(*x1);
 }
 
-
 P1(uintptr_t *x0, uintptr_t *x1)
 {
 	WRITE_ONCE(*x1, 2);
CodeSamples/formal/herd/C-SB+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus +2 -4
index 8c87d429..329a12f5 100644
@@ -1,7 +1,7 @@
 C C-SB+o-rcusync-o+rl-o-o-rul+rl-o-o-rul
 //\begin[snippet][labelbase=ln:formal:C-SB+o-rcusync-o+rl-o-o-rul+rl-o-o-rul:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -10,7 +10,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	uintptr_t r2 = READ_ONCE(*x1);
 }
 
-
 P1(uintptr_t *x1, uintptr_t *x2)
 {
 	rcu_read_lock();
@@ -19,7 +18,6 @@ P1(uintptr_t *x1, uintptr_t *x2)
 	rcu_read_unlock();
 }
 
-
 P2(uintptr_t *x2, uintptr_t *x0)
 {
 	rcu_read_lock();
CodeSamples/formal/herd/C-SB+o-rcusync-o+rl-o-o-rul.litmus +2 -3
index 5190ddf6..984d75a3 100644
@@ -1,7 +1,7 @@
 C C-SB+o-rcusync-o+rl-o-o-rul
 //\begin[snippet][labelbase=ln:formal:C-SB+o-rcusync-o+rl-o-o-rul:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -10,7 +10,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	uintptr_t r2 = READ_ONCE(*x1);
 }
 
-
 P1(uintptr_t *x0, uintptr_t *x1)
 {
 	rcu_read_lock();
CodeSamples/formal/herd/C-SB+o-rcusync-o+rl-o-rul-o.litmus +2 -3
index a39baf3a..10ce89a3 100644
@@ -1,7 +1,7 @@
 C C-SB+o-rcusync-o+rl-o-rul-o
 //\begin[snippet][labelbase=ln:formal:C-SB+o-rcusync-o+rl-o-rul-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 P0(uintptr_t *x0, uintptr_t *x1)
 {
@@ -10,7 +10,6 @@ P0(uintptr_t *x0, uintptr_t *x1)
 	uintptr_t r2 = READ_ONCE(*x1);
 }
 
-
 P1(uintptr_t *x0, uintptr_t *x1)
 {
 	rcu_read_lock();
CodeSamples/formal/litmus/C-2+2W+o-o+o-o.litmus +2 -3
index 1d75e5e6..43fd622c 100644
@@ -1,7 +1,7 @@
 C C-2+2W+o-o+o-o
 //\begin[snippet][labelbase=ln:formal:C-2+2W+o-o+o-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -13,7 +13,6 @@ P0(int *x0, int *x1)
 	WRITE_ONCE(*x1, 2);
 }
 
-
 P1(int *x0, int *x1)
 {
 	WRITE_ONCE(*x1, 1);
CodeSamples/formal/litmus/C-2+2W+o-wmb-o+o-wmb-o.litmus +2 -3
index 8d17a1d2..bea2b9a6 100644
@@ -1,7 +1,7 @@
 C C-2+2W+o-wmb-o+o-wmb-o
 //\begin[snippet][labelbase=ln:formal:C-2+2W+o-wmb-o+o-wmb-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -14,7 +14,6 @@ P0(int *x0, int *x1)
 	WRITE_ONCE(*x1, 2);
 }
 
-
 P1(int *x0, int *x1)
 {
 	WRITE_ONCE(*x1, 1);
CodeSamples/formal/litmus/C-ISA2+o-r+a-r+a-r+a-o.litmus +2 -3
index 962d1cea..b8f9cba7 100644
@@ -1,7 +1,7 @@
 C C-ISA2+o-r+a-r+a-r+a-o
 //\begin[snippet][labelbase=ln:formal:litmus:C-ISA2+o-r+a-r+a-r+a-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -13,7 +13,6 @@ P0(int *x0, int *x1)
 	smp_store_release(x1, 2);	//\lnlbl[P0:rel]
 }
 
-
 P1(int *x1, int *x2)
 {
 	int r2;
CodeSamples/formal/litmus/C-LB+a-o+o-data-o+o-data-o.litmus +2 -3
index c8e2f130..16f01665 100644
@@ -1,7 +1,7 @@
 C C-LB+a-o+o-data-o+o-data-o
 //\begin[snippet][labelbase=ln:formal:C-LB+a-o+o-data-o+o-data-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -15,7 +15,6 @@ P0(int *x0, int *x1)
 	WRITE_ONCE(*x1, 2);
 }
 
-
 P1(int *x1, int *x2)
 {
 	int r2;
CodeSamples/formal/litmus/C-LB+a-r+a-r+a-r+a-r.litmus +2 -3
index c582dfd1..1012d225 100644
@@ -1,7 +1,7 @@
 C C-LB+a-r+a-r+a-r+a-r
 //\begin[snippet][labelbase=ln:formal:C-LB+a-r+a-r+a-r+a-r:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -15,7 +15,6 @@ P0(int *x0, int *x1)
 	smp_store_release(x1, 2);
 }
 
-
 P1(int *x1, int *x2)
 {
 	int r2;
CodeSamples/formal/litmus/C-LB+cmpxchg-ctrl-o+o-ctrl-o.litmus +2 -2
index a026e2d9..dcceca18 100644
@@ -1,6 +1,6 @@
 C C-LB+cmpxchg-ctrl-o+o-ctrl-o
-{
-}
+
+{}
 
 {
 #include "api.h"
CodeSamples/formal/litmus/C-LB+o-cge-o+o-cge-o+dstb.litmus +2 -2
index e97b879a..280c3c33 100644
@@ -1,6 +1,6 @@
 C C-LB+o-cge-o+o-cge-o+dstb
-{
-}
+
+{}
 
 {
 #include "api.h"
CodeSamples/formal/litmus/C-LB+o-cge-o+o-cge-o.litmus +2 -2
index 14539b97..653fb485 100644
@@ -1,6 +1,6 @@
 C C-LB+o-cge-o+o-cge-o
-{
-}
+
+{}
 
 {
 #include "api.h"
CodeSamples/formal/litmus/C-LB+o-cgt-o+o-cgt-o.litmus +2 -2
index f8a7406c..5c41c972 100644
@@ -1,7 +1,7 @@
 C C-LB+o-cgt-o+o-cgt-o
 //\begin[snippet][labelbase=ln:formal:C-LB+o-cgt-o+o-cgt-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
CodeSamples/formal/litmus/C-LB+o-o+o-o.litmus +2 -3
index f40bb067..61da889d 100644
@@ -1,7 +1,7 @@
 C C-LB+o-o+o-o
 //\begin[snippet][labelbase=ln:formal:C-LB+o-o+o-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -15,7 +15,6 @@ P0(int *x0, int *x1)
 	WRITE_ONCE(*x0, 2);
 }
 
-
 P1(int *x0, int *x1)
 {
 	int r2;
CodeSamples/formal/litmus/C-LB+o-r+a-o.litmus +2 -3
index ac5faa81..d1f24f18 100644
@@ -1,7 +1,7 @@
 C C-LB+o-r+a-o
 //\begin[snippet][labelbase=ln:formal:C-LB+o-r+a-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {					//\fcvexclude
 #include "api.h"			//\fcvexclude
@@ -15,7 +15,6 @@ P0(int *x0, int *x1)
 	smp_store_release(x0, 2);
 }
 
-
 P1(int *x0, int *x1)
 {
 	int r2;
CodeSamples/formal/litmus/C-LB+o-r+o-ctrl-o.litmus +3 -3
index 6eede7c4..7825a87f 100644
@@ -1,7 +1,7 @@
 C C-LB+o-r+o-ctrl-o
 //\begin[snippet][labelbase=ln:formal:C-LB+o-r+o-ctrl-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -15,7 +15,6 @@ P0(int *x0, int *x1)
 	smp_store_release(x0, 2);
 }
 
-
 P1(int *x0, int *x1)
 {
 	int r2;
@@ -24,5 +23,6 @@ P1(int *x0, int *x1)
 	if (r2 >= 0)			//\lnlbl[if]
 		WRITE_ONCE(*x1, 2);	//\lnlbl[st]
 }
+
 //\end[snippet]
 exists (1:r2=2 /\ 0:r2=2)
CodeSamples/formal/litmus/C-LB+o-r+o-data-o.litmus +2 -3
index 543256e2..cb3060ba 100644
@@ -1,7 +1,7 @@
 C C-LB+o-r+o-data-o
 //\begin[snippet][labelbase=ln:formal:C-LB+o-r+o-data-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -15,7 +15,6 @@ P0(int *x0, int *x1)
 	smp_store_release(x0, 2);
 }
 
-
 P1(int *x0, int *x1)
 {
 	int r2;
CodeSamples/formal/litmus/C-MP+o-o+o-rmb-o.litmus +2 -6
index 65da9ea2..dff95bf2 100644
@@ -1,28 +1,24 @@
 C C-MP+o-o+o-rmb-o
 //\begin[snippet][labelbase=ln:formal:C-MP+o-o+o-rmb-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
 }				//\fcvexclude
 				//\fcvexclude
 P0(int* x0, int* x1) {
-
 	WRITE_ONCE(*x0, 2);
 	WRITE_ONCE(*x1, 2);
-
 }
 
 P1(int* x0, int* x1) {
-
 	int r2;
 	int r3;
 
 	r2 = READ_ONCE(*x1);
 	smp_rmb();
 	r3 = READ_ONCE(*x0);
-
 }
 
 //\end[snippet]
CodeSamples/formal/litmus/C-MP+o-r+o-ctrl-o.litmus +2 -5
index b08ad06b..28cb9e2a 100644
@@ -1,17 +1,15 @@
 C C-MP+o-r+o-ctrl-o
 //\begin[snippet][labelbase=ln:formal:C-MP+o-r+o-ctrl-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
 }				//\fcvexclude
 				//\fcvexclude
 P0(int* x0, int* x1) {
-
 	WRITE_ONCE(*x0, 2);
 	smp_store_release(x1, 2);
-
 }
 
 P1(int* x0, int* x1) {
@@ -21,7 +19,6 @@ P1(int* x0, int* x1) {
 	r2 = READ_ONCE(*x1);			//\lnlbl[ld1]
 	if (r2 >= 0)
 		r3 = READ_ONCE(*x0);		//\lnlbl[ld2]
-
 }
 
 //\end[snippet]
CodeSamples/formal/litmus/C-MP+o-wmb-o+o-addr-o.litmus +0 -4
index 865943e5..bb62bd17 100644
@@ -11,21 +11,17 @@ x1=y;			(* \lnlbl[init:x1] *)
 }				//\fcvexclude
 				//\fcvexclude
 P0(int* x0, int** x1) {
-
 	WRITE_ONCE(*x0, 2);	//\lnlbl[P0:x0]
 	smp_wmb();		//\lnlbl[P0:wmb]
 	WRITE_ONCE(*x1, x0);	//\lnlbl[P0:x1]
-
 }
 
 P1(int** x1) {
-
 	int *r2;
 	int r3;
 
 	r2 = READ_ONCE(*x1);	//\lnlbl[P1:x1]
 	r3 = READ_ONCE(*r2);	//\lnlbl[P1:ref]
-
 }
 
 //\end[snippet]
CodeSamples/formal/litmus/C-MP+o-wmb-o+o-o.litmus +1 -6
index 469ba780..6c566314 100644
@@ -1,29 +1,24 @@
 C C-MP+o-wmb-o+o-o
 //\begin[snippet][labelbase=ln:formal:C-MP+o-wmb-o+o-o:whole,commandchars=\@\[\]]
 
-{
-}
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
 }				//\fcvexclude
 				//\fcvexclude
 P0(int* x0, int* x1) {
-
 	WRITE_ONCE(*x0, 2);
 	smp_wmb();
 	WRITE_ONCE(*x1, 2);
-
 }
 
 P1(int* x0, int* x1) {
-
 	int r2;
 	int r3;
 
 	r2 = READ_ONCE(*x1);
 	r3 = READ_ONCE(*x0);
-
 }
 
 //\end[snippet]
CodeSamples/formal/litmus/C-MP+o-wmb-o+o-rmb-o.litmus +1 -6
index 5b5bf45a..60d379d6 100644
@@ -1,30 +1,25 @@
 C C-MP+o-wmb-o+o-rmb-o
 //\begin[snippet][labelbase=ln:formal:C-MP+o-wmb-o+o-rmb-o:whole,commandchars=\@\[\]]
 
-{
-}
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
 }				//\fcvexclude
 				//\fcvexclude
 P0(int* x0, int* x1) {
-
 	WRITE_ONCE(*x0, 2);
 	smp_wmb();
 	WRITE_ONCE(*x1, 2);
-
 }
 
 P1(int* x0, int* x1) {
-
 	int r2;
 	int r3;
 
 	r2 = READ_ONCE(*x1);
 	smp_rmb();			//\lnlbl[rmb]
 	r3 = READ_ONCE(*x0);
-
 }
 
 //\end[snippet]
CodeSamples/formal/litmus/C-MP-OMCA+o-o-o+o-rmb-o.litmus +2 -2
index a84573a6..c48622a6 100644
@@ -1,7 +1,7 @@
 C C-MP-OMCA+o-o-o+o-rmb-o
 //\begin[snippet][labelbase=ln:formal:C-MP-OMCA+o-o-o+o-rmb-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
CodeSamples/formal/litmus/C-R+o-wmb-o+o-mb-o.litmus +2 -3
index 7e9a5bba..e4e15b01 100644
@@ -1,7 +1,7 @@
 C C-R+o-wmb-o+o-mb-o
 //\begin[snippet][labelbase=ln:formal:C-R+o-wmb-o+o-mb-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -14,7 +14,6 @@ P0(int *x0, int *x1)
 	WRITE_ONCE(*x1, 1);
 }
 
-
 P1(int *x0, int *x1)
 {
 	int r2;
CodeSamples/formal/litmus/C-S+o-wmb-o+o-addr-o.litmus +0 -4
index 11171cd5..3bbcc4f1 100644
@@ -11,20 +11,16 @@ x1=y;
 }				//\fcvexclude
 				//\fcvexclude
 P0(int* x0, int** x1) {
-
 	WRITE_ONCE(*x0, 2);	//\lnlbl[P0:x0]
 	smp_wmb();
 	WRITE_ONCE(*x1, x0);
-
 }
 
 P1(int** x1) {
-
 	int *r2;
 
 	r2 = READ_ONCE(*x1);		//\lnlbl[P1:x1]
 	WRITE_ONCE(*r2, 3);		//\lnlbl[P1:r2]
-
 }
 
 //\end[snippet]
CodeSamples/formal/litmus/C-SB+o-mb-o+o-mb-o.litmus +2 -3
index 0357306b..4922680c 100644
@@ -1,7 +1,7 @@
 C C-SB+o-mb-o+o-mb-o
 //\begin[snippet][labelbase=ln:formal:C-SB+o-mb-o+o-mb-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -16,7 +16,6 @@ P0(int *x0, int *x1)
 	r2 = READ_ONCE(*x1);	//\lnlbl[P0:ld]
 }
 
-
 P1(int *x0, int *x1)
 {
 	int r2;
CodeSamples/formal/litmus/C-SB+o-o+o-o.litmus +3 -3
index 85022aea..fabcb5d5 100644
@@ -1,7 +1,7 @@
 C C-SB+o-o+o-o
 //\begin[snippet][labelbase=ln:formal:C-SB+o-o+o-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -15,7 +15,6 @@ P0(int *x0, int *x1)
 	r2 = READ_ONCE(*x1);	//\lnlbl[ld0]
 }
 
-
 P1(int *x0, int *x1)
 {
 	int r2;
@@ -23,5 +22,6 @@ P1(int *x0, int *x1)
 	WRITE_ONCE(*x1, 2);	//\lnlbl[st1]
 	r2 = READ_ONCE(*x0);	//\lnlbl[ld1]
 }
+
 //\end[snippet]
 exists (1:r2=0 /\ 0:r2=0)
CodeSamples/formal/litmus/C-SB-OMCA+o-o-rmb-o+o-o-rmb-o.litmus +1 -3
index e1502963..8076c0c6 100644
@@ -1,7 +1,6 @@
 C C-SB-OMCA+o-o-rmb-o+o-o-rmb-o
 
-{
-}
+{}
 
 {
 #include "api.h"
@@ -18,7 +17,6 @@ P0(int *x0, int *x1)
 	r2 = READ_ONCE(*x1);
 }
 
-
 P1(int *x0, int *x1)
 {
 	int r1;
CodeSamples/formal/litmus/C-WRC+o+o-data-o+o-rmb-o.litmus +2 -2
index 88225dde..b0960253 100644
@@ -1,7 +1,7 @@
 C C-WRC+o+o-data-o+o-rmb-o
 //\begin[snippet][labelbase=ln:formal:C-WRC+o+o-data-o+o-rmb-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
CodeSamples/formal/litmus/C-WRC+o+o-r+a-o.litmus +1 -2
index 4cd69b8f..a1f000b8 100644
@@ -1,8 +1,7 @@
 C C-WRC+o+o-r+a-o
 //\begin[snippet][labelbase=ln:formal:C-WRC+o+o-r+a-o:whole,commandchars=\@\[\]]
 
-{
-}
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
CodeSamples/formal/litmus/C-WWC+o-cge-o+o-cge-o+o+dstb.litmus +2 -2
index 015bcd0f..81c0a96a 100644
@@ -1,6 +1,6 @@
 C C-WWC+o-cge-o+o-cge-o+o+dstb
-{
-}
+
+{}
 
 {
 #include "api.h"
CodeSamples/formal/litmus/C-WWC+o-cge-o+o-cge-o+o.litmus +2 -2
index 3fcd502c..1c15a01a 100644
@@ -1,6 +1,6 @@
 C C-WWC+o-cge-o+o-cge-o+o
-{
-}
+
+{}
 
 {
 #include "api.h"
CodeSamples/formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o+dstb.litmus +2 -2
index 989d99fe..aada09f5 100644
@@ -1,6 +1,6 @@
 C C-WWC+o-cgt-o+o-cgt-o+o+dstb
-{
-}
+
+{}
 
 {
 #include "api.h"
CodeSamples/formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o.litmus +2 -2
index 9003fdce..1fd2db6f 100644
@@ -1,7 +1,7 @@
 C C-WWC+o-cgt-o+o-cgt-o+o
 //\begin[snippet][labelbase=ln:formal:C-WWC+o-cgt-o+o-cgt-o+o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
CodeSamples/formal/litmus/C-Z6.2+o-r+a-r+a-r+a-o.litmus +2 -3
index dc89015d..db90e958 100644
@@ -1,7 +1,7 @@
 C C-Z6.2+o-r+a-r+a-r+a-o
 //\begin[snippet][labelbase=ln:formal:C-Z6.2+o-r+a-r+a-r+a-o:whole,commandchars=\@\[\]]
-{
-}
+
+{}
 
 {				//\fcvexclude
 #include "api.h"		//\fcvexclude
@@ -13,7 +13,6 @@ P0(int *x0, int *x1)
 	smp_store_release(x1, 2);
 }
 
-
 P1(int *x1, int *x2)
 {
 	int r2;
CodeSamples/formal/litmus/C-cmpxchg.litmus +2 -2
index 9579d4a7..aba438bd 100644
@@ -1,6 +1,6 @@
 C C-cmpxchg
-{
-}
+
+{}
 
 {
 #include "api.h"
Signature · 1 line
2.17.1
#3 lore raw
In reply to Akira Yokosawa
Quoted 22 lines · Akira Yokosawa

Hi Paul,

This patch set is what I mentioned the other day in response to your LKMM patch for 5.11.
klitmus7 doesn't need most of type info in litmus-test init blocks.

While there are some cases where klitmus7 requires type info of variables to be watched (via the "exists", "locations", or "filter" directive), as long as the watched variables are of type "int", extra type info in the init block is not required.

Litmus tests under CodeSamples/formal/ should keep compatible with klitmus7 after this patch set is applied.

Patch 1/2 removes initialization to 0 and type info of "int" or "int *" under CodeSamples/formal/litmus/.

Patch 2/2 further reduce line counts of litmus tests by using "{}" as empty init blocks.
It also adds/removes empty lines for those code snippets to have consistent looks.

Quoted 4 lines

Similar changes to patch 1/2 can be made in the RCU litmus tests presented in Section 12.3.2. They are not touched in this patch set.

May be in a follow-up patch.

Queued and pushed, thank you very much!

Quoted 4 lines

Thanks, Akira

*NOTE*:

Quoted 8 lines

There are cases where litmus tests for herd7 can not be made compatible with (current) klitmus7, though.

One such example is when a variable of a type other than the "int" or "int *" (such as "spinlock_t") is specified in the "locations" or "filter" directive.
Current klitmus7 has no idea of the way to obtain the value of such a variable.

Good to know! Do we have litmus tests that have problems with this?

Quoted 3 lines

As for herd7, all the variables are treated as if they were "int" or "int *" regardless of the type specified in the litmus tests, there is no such problem.

Indeed, herd7 lets you get away with quite a bit. ;-)

Thanx, Paul

Quoted 83 lines

--
Akira Yokosawa (2):
CodeSamples/formal/litmus: Remove redundant initializations CodeSamples/formal: Use '{}' for empty init blocks in litmus tests

 CodeSamples/formal/herd/C-LB+o-rl-rul-o+o-rl-rul-o.litmus | 5 ++---
 CodeSamples/formal/herd/C-LB+rl-o-o-rul+rl-o-o-rul.litmus | 5 ++---
 CodeSamples/formal/herd/C-Lock1.litmus                    | 5 +++--
 CodeSamples/formal/herd/C-Lock2.litmus                    | 5 +++--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus | 3 +--
 ...C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus | 3 +--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus | 3 +--
 ...C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus | 3 +--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus    | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus    | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus      | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus     | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus    | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus     | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus    | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u.litmus       | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-C.litmus     | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-CE.litmus    | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-X.litmus     | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-XE.litmus    | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u.litmus       | 3 +--
 .../formal/herd/C-SB+o-rcusync-o+i-rl-o-o-rul.litmus      | 5 ++---
 CodeSamples/formal/herd/C-SB+o-rcusync-o+o-o.litmus       | 5 ++---
 ...B+o-rcusync-o+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus | 7 ++-----
 .../formal/herd/C-SB+o-rcusync-o+o-rcusync-o.litmus       | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+o-rl-o-rul.litmus        | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+o-rl-rul-o.litmus        | 5 ++---
 .../herd/C-SB+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus    | 6 ++----
 .../formal/herd/C-SB+o-rcusync-o+rl-o-o-rul.litmus        | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+rl-o-rul-o.litmus        | 5 ++---
 CodeSamples/formal/litmus/C-2+2W+o-o+o-o.litmus           | 5 ++---
 CodeSamples/formal/litmus/C-2+2W+o-wmb-o+o-wmb-o.litmus   | 5 ++---
 CodeSamples/formal/litmus/C-CCIRIW+o+o+o-o+o-o.litmus     | 5 ++---
 CodeSamples/formal/litmus/C-ISA2+o-r+a-r+a-r+a-o.litmus   | 5 ++---
 .../formal/litmus/C-LB+a-o+o-data-o+o-data-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-LB+a-r+a-r+a-r+a-r.litmus     | 5 ++---
 .../formal/litmus/C-LB+cmpxchg-ctrl-o+o-ctrl-o.litmus     | 4 ++--
 .../formal/litmus/C-LB+o-cge-o+o-cge-o+dstb.litmus        | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-cge-o+o-cge-o.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-cgt-o+o-cgt-o.litmus     | 4 ++--
 .../formal/litmus/C-LB+o-data-o+o-data-o+o-data-o.litmus  | 7 +++----
 CodeSamples/formal/litmus/C-LB+o-o+o-o.litmus             | 5 ++---
 CodeSamples/formal/litmus/C-LB+o-r+a-o.litmus             | 5 ++---
 CodeSamples/formal/litmus/C-LB+o-r+o-ctrl-o.litmus        | 6 +++---
 CodeSamples/formal/litmus/C-LB+o-r+o-data-o.litmus        | 5 ++---
 CodeSamples/formal/litmus/C-MP+o-o+o-rmb-o.litmus         | 8 ++------
 CodeSamples/formal/litmus/C-MP+o-r+o-ctrl-o.litmus        | 7 ++-----
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-addr-o.litmus    | 8 ++------
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-o.litmus         | 7 +------
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-rmb-o.litmus     | 7 +------
 CodeSamples/formal/litmus/C-MP-OMCA+o-o-o+o-rmb-o.litmus  | 4 ++--
 CodeSamples/formal/litmus/C-R+o-wmb-o+o-mb-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-S+o-wmb-o+o-addr-o.litmus     | 8 ++------
 CodeSamples/formal/litmus/C-SB+o-mb-o+o-mb-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-SB+o-o+o-o.litmus             | 6 +++---
 .../formal/litmus/C-SB-OMCA+o-o-rmb-o+o-o-rmb-o.litmus    | 4 +---
 .../formal/litmus/C-W+RWC+o-mb-o+a-o+o-mb-o.litmus        | 6 +-----
 CodeSamples/formal/litmus/C-W+RWC+o-r+a-o+o-mb-o.litmus   | 6 +-----
 CodeSamples/formal/litmus/C-WRC+o+o-data-o+o-rmb-o.litmus | 4 ++--
 CodeSamples/formal/litmus/C-WRC+o+o-r+a-o.litmus          | 3 +--
 .../formal/litmus/C-WWC+o+o-data-o+o-addr-o.litmus        | 6 ++----
 CodeSamples/formal/litmus/C-WWC+o+o-r+o-addr-o.litmus     | 6 ++----
 .../formal/litmus/C-WWC+o-cge-o+o-cge-o+o+dstb.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-WWC+o-cge-o+o-cge-o+o.litmus  | 4 ++--
 .../formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o+dstb.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o.litmus  | 4 ++--
 CodeSamples/formal/litmus/C-Z6.2+o-r+a-o+o-mb-o.litmus    | 6 +-----
 CodeSamples/formal/litmus/C-Z6.2+o-r+a-r+a-r+a-o.litmus   | 5 ++---
 CodeSamples/formal/litmus/C-cmpxchg.litmus                | 4 ++--
 memorder/memorder.tex                                     | 8 ++------
 73 files changed, 124 insertions(+), 217 deletions(-)
Signature · 1 line
2.17.1
#4 lore raw
Quoted 37 lines · Paul E. McKenney
Quoted 22 lines · Akira Yokosawa

Hi Paul,

This patch set is what I mentioned the other day in response to your LKMM patch for 5.11.
klitmus7 doesn't need most of type info in litmus-test init blocks.

While there are some cases where klitmus7 requires type info of variables to be watched (via the "exists", "locations", or "filter" directive), as long as the watched variables are of type "int", extra type info in the init block is not required.

Litmus tests under CodeSamples/formal/ should keep compatible with klitmus7 after this patch set is applied.

Patch 1/2 removes initialization to 0 and type info of "int" or "int *" under CodeSamples/formal/litmus/.

Patch 2/2 further reduce line counts of litmus tests by using "{}" as empty init blocks.
It also adds/removes empty lines for those code snippets to have consistent looks.

Quoted 4 lines

Similar changes to patch 1/2 can be made in the RCU litmus tests presented in Section 12.3.2. They are not touched in this patch set.

May be in a follow-up patch.

Queued and pushed, thank you very much!

Quoted 7 lines

Thanks, Akira

*NOTE*:

There are cases where litmus tests for herd7 can not be made compatible with (current) klitmus7, though.

Quoted 7 lines
Quoted 5 lines

One such example is when a variable of a type other than the "int" or "int *" (such as "spinlock_t") is specified in the "locations" or "filter" directive.
Current klitmus7 has no idea of the way to obtain the value of such a variable.

Good to know! Do we have litmus tests that have problems with this?

One such litmus test can be made up based on CodeSamples/formal/herd/C-Lock1.litmus

---
C Lock1-for-herd7

(*
* Example test incompatible with klitmus7
*
* klitmus7 cannot access spinlock_t variable.
*)

{}

P0(int *x, spinlock_t *sp)

{
	spin_lock(sp);
	WRITE_ONCE(*x, 1);
	WRITE_ONCE(*x, 0);
	spin_unlock(sp);
}

P1(int *x, spinlock_t *sp)

{
	int r1;

	spin_lock(sp);
	r1 = READ_ONCE(*x);
	spin_unlock(sp);
}

locations [sp] (* incompatible with klitmus7 *)
exists (1:r1=1)
---

klitmus7 can't convert this to a kernel module:

---

$ klitmus7 -o temp C-Lock1-for-herd7.litmus
File "C-Lock1-for-herd7.litmus" Parameter sp, type mismatch int vs. spinlock_t
---

Actually, herd7/LKMM does complain of this one:

---
Test Lock1-for-herd7 Allowed
States 1
1:r1=0; sp=0;
No
Witnesses
Positive: 0 Negative: 2
Flag lock-final <---
Condition exists (1:r1=1)
Observation Lock1-for-herd7 Never 0 2
Time Lock1-for-herd7 0.01
Hash=5d10e6c355cec0c36f354abf175adc54
---

Comment at line 57 of lock.cat says:

---
(* The final value of a spinlock should not be tested *) flag ~empty [FW] ; loc ; [ALL-LOCKS] as lock-final
---

Thanks, Akira

Quoted 92 lines
Quoted 4 lines

As for herd7, all the variables are treated as if they were "int" or "int *" regardless of the type specified in the litmus tests, there is no such problem.

Indeed, herd7 lets you get away with quite a bit. ;-)

Thanx, Paul

Quoted 83 lines

--
Akira Yokosawa (2):
CodeSamples/formal/litmus: Remove redundant initializations CodeSamples/formal: Use '{}' for empty init blocks in litmus tests

 CodeSamples/formal/herd/C-LB+o-rl-rul-o+o-rl-rul-o.litmus | 5 ++---
 CodeSamples/formal/herd/C-LB+rl-o-o-rul+rl-o-o-rul.litmus | 5 ++---
 CodeSamples/formal/herd/C-Lock1.litmus                    | 5 +++--
 CodeSamples/formal/herd/C-Lock2.litmus                    | 5 +++--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus | 3 +--
 ...C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus | 3 +--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus | 3 +--
 ...C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus | 3 +--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus    | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus    | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus      | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus     | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus    | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus     | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus    | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u.litmus       | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-C.litmus     | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-CE.litmus    | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-X.litmus     | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-XE.litmus    | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u.litmus       | 3 +--
 .../formal/herd/C-SB+o-rcusync-o+i-rl-o-o-rul.litmus      | 5 ++---
 CodeSamples/formal/herd/C-SB+o-rcusync-o+o-o.litmus       | 5 ++---
 ...B+o-rcusync-o+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus | 7 ++-----
 .../formal/herd/C-SB+o-rcusync-o+o-rcusync-o.litmus       | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+o-rl-o-rul.litmus        | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+o-rl-rul-o.litmus        | 5 ++---
 .../herd/C-SB+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus    | 6 ++----
 .../formal/herd/C-SB+o-rcusync-o+rl-o-o-rul.litmus        | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+rl-o-rul-o.litmus        | 5 ++---
 CodeSamples/formal/litmus/C-2+2W+o-o+o-o.litmus           | 5 ++---
 CodeSamples/formal/litmus/C-2+2W+o-wmb-o+o-wmb-o.litmus   | 5 ++---
 CodeSamples/formal/litmus/C-CCIRIW+o+o+o-o+o-o.litmus     | 5 ++---
 CodeSamples/formal/litmus/C-ISA2+o-r+a-r+a-r+a-o.litmus   | 5 ++---
 .../formal/litmus/C-LB+a-o+o-data-o+o-data-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-LB+a-r+a-r+a-r+a-r.litmus     | 5 ++---
 .../formal/litmus/C-LB+cmpxchg-ctrl-o+o-ctrl-o.litmus     | 4 ++--
 .../formal/litmus/C-LB+o-cge-o+o-cge-o+dstb.litmus        | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-cge-o+o-cge-o.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-cgt-o+o-cgt-o.litmus     | 4 ++--
 .../formal/litmus/C-LB+o-data-o+o-data-o+o-data-o.litmus  | 7 +++----
 CodeSamples/formal/litmus/C-LB+o-o+o-o.litmus             | 5 ++---
 CodeSamples/formal/litmus/C-LB+o-r+a-o.litmus             | 5 ++---
 CodeSamples/formal/litmus/C-LB+o-r+o-ctrl-o.litmus        | 6 +++---
 CodeSamples/formal/litmus/C-LB+o-r+o-data-o.litmus        | 5 ++---
 CodeSamples/formal/litmus/C-MP+o-o+o-rmb-o.litmus         | 8 ++------
 CodeSamples/formal/litmus/C-MP+o-r+o-ctrl-o.litmus        | 7 ++-----
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-addr-o.litmus    | 8 ++------
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-o.litmus         | 7 +------
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-rmb-o.litmus     | 7 +------
 CodeSamples/formal/litmus/C-MP-OMCA+o-o-o+o-rmb-o.litmus  | 4 ++--
 CodeSamples/formal/litmus/C-R+o-wmb-o+o-mb-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-S+o-wmb-o+o-addr-o.litmus     | 8 ++------
 CodeSamples/formal/litmus/C-SB+o-mb-o+o-mb-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-SB+o-o+o-o.litmus             | 6 +++---
 .../formal/litmus/C-SB-OMCA+o-o-rmb-o+o-o-rmb-o.litmus    | 4 +---
 .../formal/litmus/C-W+RWC+o-mb-o+a-o+o-mb-o.litmus        | 6 +-----
 CodeSamples/formal/litmus/C-W+RWC+o-r+a-o+o-mb-o.litmus   | 6 +-----
 CodeSamples/formal/litmus/C-WRC+o+o-data-o+o-rmb-o.litmus | 4 ++--
 CodeSamples/formal/litmus/C-WRC+o+o-r+a-o.litmus          | 3 +--
 .../formal/litmus/C-WWC+o+o-data-o+o-addr-o.litmus        | 6 ++----
 CodeSamples/formal/litmus/C-WWC+o+o-r+o-addr-o.litmus     | 6 ++----
 .../formal/litmus/C-WWC+o-cge-o+o-cge-o+o+dstb.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-WWC+o-cge-o+o-cge-o+o.litmus  | 4 ++--
 .../formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o+dstb.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o.litmus  | 4 ++--
 CodeSamples/formal/litmus/C-Z6.2+o-r+a-o+o-mb-o.litmus    | 6 +-----
 CodeSamples/formal/litmus/C-Z6.2+o-r+a-r+a-r+a-o.litmus   | 5 ++---
 CodeSamples/formal/litmus/C-cmpxchg.litmus                | 4 ++--
 memorder/memorder.tex                                     | 8 ++------
 73 files changed, 124 insertions(+), 217 deletions(-)
Signature · 1 line
2.17.1
#5 lore raw
Quoted 44 lines · Akira Yokosawa
Quoted 43 lines · Paul E. McKenney
Quoted 22 lines · Akira Yokosawa

Hi Paul,

This patch set is what I mentioned the other day in response to your LKMM patch for 5.11.
klitmus7 doesn't need most of type info in litmus-test init blocks.

While there are some cases where klitmus7 requires type info of variables to be watched (via the "exists", "locations", or "filter" directive), as long as the watched variables are of type "int", extra type info in the init block is not required.

Litmus tests under CodeSamples/formal/ should keep compatible with klitmus7 after this patch set is applied.

Patch 1/2 removes initialization to 0 and type info of "int" or "int *" under CodeSamples/formal/litmus/.

Patch 2/2 further reduce line counts of litmus tests by using "{}" as empty init blocks.
It also adds/removes empty lines for those code snippets to have consistent looks.

Quoted 4 lines

Similar changes to patch 1/2 can be made in the RCU litmus tests presented in Section 12.3.2. They are not touched in this patch set.

May be in a follow-up patch.

Queued and pushed, thank you very much!

Quoted 12 lines

Thanks, Akira

*NOTE*:

There are cases where litmus tests for herd7 can not be made compatible with (current) klitmus7, though.

One such example is when a variable of a type other than the "int" or "int *" (such as "spinlock_t") is specified in the "locations" or "filter" directive.
Current klitmus7 has no idea of the way to obtain the value of such a variable.

Quoted 3 lines
Quoted 1 line

Good to know! Do we have litmus tests that have problems with this?

One such litmus test can be made up based on CodeSamples/formal/herd/C-Lock1.litmus

So there is not currently such a litmus test in perfbook, but one could easily be created, correct?

Or am I still confused? ;-)

Thanx, Paul

Quoted 156 lines

---
C Lock1-for-herd7

(*
* Example test incompatible with klitmus7
*
* klitmus7 cannot access spinlock_t variable.
*)

{}

P0(int *x, spinlock_t *sp)

{
	spin_lock(sp);
	WRITE_ONCE(*x, 1);
	WRITE_ONCE(*x, 0);
	spin_unlock(sp);
}

P1(int *x, spinlock_t *sp)

{
	int r1;

	spin_lock(sp);
	r1 = READ_ONCE(*x);
	spin_unlock(sp);
}

locations [sp] (* incompatible with klitmus7 *)
exists (1:r1=1)
---

klitmus7 can't convert this to a kernel module:

---

$ klitmus7 -o temp C-Lock1-for-herd7.litmus
File "C-Lock1-for-herd7.litmus" Parameter sp, type mismatch int vs. spinlock_t
---

Actually, herd7/LKMM does complain of this one:

---
Test Lock1-for-herd7 Allowed
States 1
1:r1=0; sp=0;
No
Witnesses
Positive: 0 Negative: 2
Flag lock-final <---
Condition exists (1:r1=1)
Observation Lock1-for-herd7 Never 0 2
Time Lock1-for-herd7 0.01
Hash=5d10e6c355cec0c36f354abf175adc54
---

Comment at line 57 of lock.cat says:

---
(* The final value of a spinlock should not be tested *) flag ~empty [FW] ; loc ; [ALL-LOCKS] as lock-final
---

Thanks, Akira

Quoted 92 lines
Quoted 4 lines

As for herd7, all the variables are treated as if they were "int" or "int *" regardless of the type specified in the litmus tests, there is no such problem.

Indeed, herd7 lets you get away with quite a bit. ;-)

Thanx, Paul

Quoted 83 lines

--
Akira Yokosawa (2):
CodeSamples/formal/litmus: Remove redundant initializations CodeSamples/formal: Use '{}' for empty init blocks in litmus tests

 CodeSamples/formal/herd/C-LB+o-rl-rul-o+o-rl-rul-o.litmus | 5 ++---
 CodeSamples/formal/herd/C-LB+rl-o-o-rul+rl-o-o-rul.litmus | 5 ++---
 CodeSamples/formal/herd/C-Lock1.litmus                    | 5 +++--
 CodeSamples/formal/herd/C-Lock2.litmus                    | 5 +++--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus | 3 +--
 ...C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus | 3 +--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus | 3 +--
 ...C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus | 3 +--
 .../C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus    | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus    | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus   | 3 +--
 .../herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u+l-o-o-u.litmus      | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-C.litmus     | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-CE.litmus    | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-X.litmus     | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u-XE.litmus    | 3 +--
 .../formal/herd/C-SB+l-o-o-u+l-o-o-u+l-o-o-u.litmus       | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-C.litmus     | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-CE.litmus    | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-X.litmus     | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u-XE.litmus    | 3 +--
 CodeSamples/formal/herd/C-SB+l-o-o-u+l-o-o-u.litmus       | 3 +--
 .../formal/herd/C-SB+o-rcusync-o+i-rl-o-o-rul.litmus      | 5 ++---
 CodeSamples/formal/herd/C-SB+o-rcusync-o+o-o.litmus       | 5 ++---
 ...B+o-rcusync-o+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus | 7 ++-----
 .../formal/herd/C-SB+o-rcusync-o+o-rcusync-o.litmus       | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+o-rl-o-rul.litmus        | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+o-rl-rul-o.litmus        | 5 ++---
 .../herd/C-SB+o-rcusync-o+rl-o-o-rul+rl-o-o-rul.litmus    | 6 ++----
 .../formal/herd/C-SB+o-rcusync-o+rl-o-o-rul.litmus        | 5 ++---
 .../formal/herd/C-SB+o-rcusync-o+rl-o-rul-o.litmus        | 5 ++---
 CodeSamples/formal/litmus/C-2+2W+o-o+o-o.litmus           | 5 ++---
 CodeSamples/formal/litmus/C-2+2W+o-wmb-o+o-wmb-o.litmus   | 5 ++---
 CodeSamples/formal/litmus/C-CCIRIW+o+o+o-o+o-o.litmus     | 5 ++---
 CodeSamples/formal/litmus/C-ISA2+o-r+a-r+a-r+a-o.litmus   | 5 ++---
 .../formal/litmus/C-LB+a-o+o-data-o+o-data-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-LB+a-r+a-r+a-r+a-r.litmus     | 5 ++---
 .../formal/litmus/C-LB+cmpxchg-ctrl-o+o-ctrl-o.litmus     | 4 ++--
 .../formal/litmus/C-LB+o-cge-o+o-cge-o+dstb.litmus        | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-cge-o+o-cge-o.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-LB+o-cgt-o+o-cgt-o.litmus     | 4 ++--
 .../formal/litmus/C-LB+o-data-o+o-data-o+o-data-o.litmus  | 7 +++----
 CodeSamples/formal/litmus/C-LB+o-o+o-o.litmus             | 5 ++---
 CodeSamples/formal/litmus/C-LB+o-r+a-o.litmus             | 5 ++---
 CodeSamples/formal/litmus/C-LB+o-r+o-ctrl-o.litmus        | 6 +++---
 CodeSamples/formal/litmus/C-LB+o-r+o-data-o.litmus        | 5 ++---
 CodeSamples/formal/litmus/C-MP+o-o+o-rmb-o.litmus         | 8 ++------
 CodeSamples/formal/litmus/C-MP+o-r+o-ctrl-o.litmus        | 7 ++-----
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-addr-o.litmus    | 8 ++------
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-o.litmus         | 7 +------
 CodeSamples/formal/litmus/C-MP+o-wmb-o+o-rmb-o.litmus     | 7 +------
 CodeSamples/formal/litmus/C-MP-OMCA+o-o-o+o-rmb-o.litmus  | 4 ++--
 CodeSamples/formal/litmus/C-R+o-wmb-o+o-mb-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-S+o-wmb-o+o-addr-o.litmus     | 8 ++------
 CodeSamples/formal/litmus/C-SB+o-mb-o+o-mb-o.litmus       | 5 ++---
 CodeSamples/formal/litmus/C-SB+o-o+o-o.litmus             | 6 +++---
 .../formal/litmus/C-SB-OMCA+o-o-rmb-o+o-o-rmb-o.litmus    | 4 +---
 .../formal/litmus/C-W+RWC+o-mb-o+a-o+o-mb-o.litmus        | 6 +-----
 CodeSamples/formal/litmus/C-W+RWC+o-r+a-o+o-mb-o.litmus   | 6 +-----
 CodeSamples/formal/litmus/C-WRC+o+o-data-o+o-rmb-o.litmus | 4 ++--
 CodeSamples/formal/litmus/C-WRC+o+o-r+a-o.litmus          | 3 +--
 .../formal/litmus/C-WWC+o+o-data-o+o-addr-o.litmus        | 6 ++----
 CodeSamples/formal/litmus/C-WWC+o+o-r+o-addr-o.litmus     | 6 ++----
 .../formal/litmus/C-WWC+o-cge-o+o-cge-o+o+dstb.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-WWC+o-cge-o+o-cge-o+o.litmus  | 4 ++--
 .../formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o+dstb.litmus     | 4 ++--
 CodeSamples/formal/litmus/C-WWC+o-cgt-o+o-cgt-o+o.litmus  | 4 ++--
 CodeSamples/formal/litmus/C-Z6.2+o-r+a-o+o-mb-o.litmus    | 6 +-----
 CodeSamples/formal/litmus/C-Z6.2+o-r+a-r+a-r+a-o.litmus   | 5 ++---
 CodeSamples/formal/litmus/C-cmpxchg.litmus                | 4 ++--
 memorder/memorder.tex                                     | 8 ++------
 73 files changed, 124 insertions(+), 217 deletions(-)
Signature · 1 line
2.17.1
#6 lore raw
Quoted 45 lines · Paul E. McKenney
Quoted 44 lines · Akira Yokosawa
Quoted 43 lines · Paul E. McKenney
Quoted 22 lines · Akira Yokosawa

Hi Paul,

This patch set is what I mentioned the other day in response to your LKMM patch for 5.11.
klitmus7 doesn't need most of type info in litmus-test init blocks.

While there are some cases where klitmus7 requires type info of variables to be watched (via the "exists", "locations", or "filter" directive), as long as the watched variables are of type "int", extra type info in the init block is not required.

Litmus tests under CodeSamples/formal/ should keep compatible with klitmus7 after this patch set is applied.

Patch 1/2 removes initialization to 0 and type info of "int" or "int *" under CodeSamples/formal/litmus/.

Patch 2/2 further reduce line counts of litmus tests by using "{}" as empty init blocks.
It also adds/removes empty lines for those code snippets to have consistent looks.

Quoted 4 lines

Similar changes to patch 1/2 can be made in the RCU litmus tests presented in Section 12.3.2. They are not touched in this patch set.

May be in a follow-up patch.

Queued and pushed, thank you very much!

Quoted 12 lines

Thanks, Akira

*NOTE*:

There are cases where litmus tests for herd7 can not be made compatible with (current) klitmus7, though.

One such example is when a variable of a type other than the "int" or "int *" (such as "spinlock_t") is specified in the "locations" or "filter" directive.
Current klitmus7 has no idea of the way to obtain the value of such a variable.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Good to know! Do we have litmus tests that have problems with this?

One such litmus test can be made up based on CodeSamples/formal/herd/C-Lock1.litmus

So there is not currently such a litmus test in perfbook, but one could easily be created, correct?

You are right!

Thanks, Akira

PS.

I'm preparing a patch series to add an index framework in perfbook. My plan is to add a specific make target for the time being to have such index pages printed.
As you should know, the hard part is to embed a *lot* of index annotations in .tex source files.

I'm thinking of splitting indexes into a general one and API index. By API, I mean functions such as smp_mb(), READ_ONCE(), etc.

API index can have kernel API, perfbook specific API, C11 API, and GCC API.

As for words/terms, if you can provide me a wish list you'd like to see in the general index, I'm willing to add such annotations.
My starting point of the general index is the Glossary.

Thoughts?

Quoted 69 lines

Or am I still confused? ;-)

Thanx, Paul

Quoted 64 lines

---
C Lock1-for-herd7

(*
* Example test incompatible with klitmus7
*
* klitmus7 cannot access spinlock_t variable.
*)

{}

P0(int *x, spinlock_t *sp)

{
	spin_lock(sp);
	WRITE_ONCE(*x, 1);
	WRITE_ONCE(*x, 0);
	spin_unlock(sp);
}

P1(int *x, spinlock_t *sp)

{
	int r1;

	spin_lock(sp);
	r1 = READ_ONCE(*x);
	spin_unlock(sp);
}

locations [sp] (* incompatible with klitmus7 *)
exists (1:r1=1)
---

klitmus7 can't convert this to a kernel module:

---

$ klitmus7 -o temp C-Lock1-for-herd7.litmus
File "C-Lock1-for-herd7.litmus" Parameter sp, type mismatch int vs. spinlock_t
---

Actually, herd7/LKMM does complain of this one:

---
Test Lock1-for-herd7 Allowed
States 1
1:r1=0; sp=0;
No
Witnesses
Positive: 0 Negative: 2
Flag lock-final <---
Condition exists (1:r1=1)
Observation Lock1-for-herd7 Never 0 2
Time Lock1-for-herd7 0.01
Hash=5d10e6c355cec0c36f354abf175adc54
---

Comment at line 57 of lock.cat says:

---
(* The final value of a spinlock should not be tested *) flag ~empty [FW] ; loc ; [ALL-LOCKS] as lock-final
---

Thanks, Akira

[...]

#7 lore raw
Quoted 57 lines · Akira Yokosawa
Quoted 45 lines · Paul E. McKenney
Quoted 44 lines · Akira Yokosawa
Quoted 43 lines · Paul E. McKenney
Quoted 22 lines · Akira Yokosawa

Hi Paul,

This patch set is what I mentioned the other day in response to your LKMM patch for 5.11.
klitmus7 doesn't need most of type info in litmus-test init blocks.

While there are some cases where klitmus7 requires type info of variables to be watched (via the "exists", "locations", or "filter" directive), as long as the watched variables are of type "int", extra type info in the init block is not required.

Litmus tests under CodeSamples/formal/ should keep compatible with klitmus7 after this patch set is applied.

Patch 1/2 removes initialization to 0 and type info of "int" or "int *" under CodeSamples/formal/litmus/.

Patch 2/2 further reduce line counts of litmus tests by using "{}" as empty init blocks.
It also adds/removes empty lines for those code snippets to have consistent looks.

Quoted 4 lines

Similar changes to patch 1/2 can be made in the RCU litmus tests presented in Section 12.3.2. They are not touched in this patch set.

May be in a follow-up patch.

Queued and pushed, thank you very much!

Quoted 12 lines

Thanks, Akira

*NOTE*:

There are cases where litmus tests for herd7 can not be made compatible with (current) klitmus7, though.

One such example is when a variable of a type other than the "int" or "int *" (such as "spinlock_t") is specified in the "locations" or "filter" directive.
Current klitmus7 has no idea of the way to obtain the value of such a variable.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Good to know! Do we have litmus tests that have problems with this?

One such litmus test can be made up based on CodeSamples/formal/herd/C-Lock1.litmus

So there is not currently such a litmus test in perfbook, but one could easily be created, correct?

You are right!

Thanks, Akira

Quoted 7 lines

PS.

I'm preparing a patch series to add an index framework in perfbook. My plan is to add a specific make target for the time being to have such index pages printed.
As you should know, the hard part is to embed a *lot* of index annotations in .tex source files.

Quite right, it is a big job!

Quoted 4 lines

I'm thinking of splitting indexes into a general one and API index. By API, I mean functions such as smp_mb(), READ_ONCE(), etc.

API index can have kernel API, perfbook specific API, C11 API, and GCC API.

The upside is that the individual indexes are smaller and perhaps more manageable. The downside is that a reader who has no idea what the function call is might have to look it up in four (or maybe even five) indexes. Especially if the API is a historic API that is no longer used.

I have no idea what the right answer is. One approach would be to have all of the APIs appear both in their respective categories and in the general index. Not sure that this would be any better, though.

Quoted 3 lines

As for words/terms, if you can provide me a wish list you'd like to see in the general index, I'm willing to add such annotations.
My starting point of the general index is the Glossary.

The glossary is a good starting point. People mentioned in the text is another. Not sure whether or not those quoted in the epigraphs should be included or not. Names of algorithms should be included, also names of data structures and of famous problems (for example, the Dining Philosopher's problem, mazes, and so on).

I am sure that I am missing quite a few categories, but at least a start! ;-)

Thanx, Paul

Quoted 73 lines

Thoughts?

Quoted 69 lines

Or am I still confused? ;-)

Thanx, Paul

Quoted 64 lines

---
C Lock1-for-herd7

(*
* Example test incompatible with klitmus7
*
* klitmus7 cannot access spinlock_t variable.
*)

{}

P0(int *x, spinlock_t *sp)

{
	spin_lock(sp);
	WRITE_ONCE(*x, 1);
	WRITE_ONCE(*x, 0);
	spin_unlock(sp);
}

P1(int *x, spinlock_t *sp)

{
	int r1;

	spin_lock(sp);
	r1 = READ_ONCE(*x);
	spin_unlock(sp);
}

locations [sp] (* incompatible with klitmus7 *)
exists (1:r1=1)
---

klitmus7 can't convert this to a kernel module:

---

$ klitmus7 -o temp C-Lock1-for-herd7.litmus
File "C-Lock1-for-herd7.litmus" Parameter sp, type mismatch int vs. spinlock_t
---

Actually, herd7/LKMM does complain of this one:

---
Test Lock1-for-herd7 Allowed
States 1
1:r1=0; sp=0;
No
Witnesses
Positive: 0 Negative: 2
Flag lock-final <---
Condition exists (1:r1=1)
Observation Lock1-for-herd7 Never 0 2
Time Lock1-for-herd7 0.01
Hash=5d10e6c355cec0c36f354abf175adc54
---

Comment at line 57 of lock.cat says:

---
(* The final value of a spinlock should not be tested *) flag ~empty [FW] ; loc ; [ALL-LOCKS] as lock-final
---

Thanks, Akira

[...]

#8 lore raw

Index in Perfbook (was Re: [PATCH perfbook 0/2] CodeSamples/formal: Cleanup of init blocks in litmus tests)

Quoted 79 lines · Paul E. McKenney
Quoted 57 lines · Akira Yokosawa
Quoted 45 lines · Paul E. McKenney
Quoted 44 lines · Akira Yokosawa
Quoted 43 lines · Paul E. McKenney
Quoted 22 lines · Akira Yokosawa

Hi Paul,

This patch set is what I mentioned the other day in response to your LKMM patch for 5.11.
klitmus7 doesn't need most of type info in litmus-test init blocks.

While there are some cases where klitmus7 requires type info of variables to be watched (via the "exists", "locations", or "filter" directive), as long as the watched variables are of type "int", extra type info in the init block is not required.

Litmus tests under CodeSamples/formal/ should keep compatible with klitmus7 after this patch set is applied.

Patch 1/2 removes initialization to 0 and type info of "int" or "int *" under CodeSamples/formal/litmus/.

Patch 2/2 further reduce line counts of litmus tests by using "{}" as empty init blocks.
It also adds/removes empty lines for those code snippets to have consistent looks.

Quoted 4 lines

Similar changes to patch 1/2 can be made in the RCU litmus tests presented in Section 12.3.2. They are not touched in this patch set.

May be in a follow-up patch.

Queued and pushed, thank you very much!

Quoted 12 lines

Thanks, Akira

*NOTE*:

There are cases where litmus tests for herd7 can not be made compatible with (current) klitmus7, though.

One such example is when a variable of a type other than the "int" or "int *" (such as "spinlock_t") is specified in the "locations" or "filter" directive.
Current klitmus7 has no idea of the way to obtain the value of such a variable.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Good to know! Do we have litmus tests that have problems with this?

One such litmus test can be made up based on CodeSamples/formal/herd/C-Lock1.litmus

So there is not currently such a litmus test in perfbook, but one could easily be created, correct?

You are right!

Thanks, Akira

Quoted 7 lines

PS.

I'm preparing a patch series to add an index framework in perfbook. My plan is to add a specific make target for the time being to have such index pages printed.
As you should know, the hard part is to embed a *lot* of index annotations in .tex source files.

Quite right, it is a big job!

Quoted 4 lines

I'm thinking of splitting indexes into a general one and API index. By API, I mean functions such as smp_mb(), READ_ONCE(), etc.

API index can have kernel API, perfbook specific API, C11 API, and GCC API.

The upside is that the individual indexes are smaller and perhaps more manageable. The downside is that a reader who has no idea what the function call is might have to look it up in four (or maybe even five) indexes. Especially if the API is a historic API that is no longer used.

Quoted 3 lines

I have no idea what the right answer is. One approach would be to have all of the APIs appear both in their respective categories and in the general index. Not sure that this would be any better, though.

My idea is to merge all the APIs into a single API Index. Category of each API can be shown there like:

    __atomic_load() (GCC), <pages>
    ACCESS_ONCE() (kernel, historic), <pages>
    atomic_inc() (kernel), <pages>
    atomic_load() (C11), <pages>
    fork() (POSIX), <pages>
    smp_mb() (kernel), <pages>
    smp_read_barrier_depends() (kernel, historic), <pages>

Give or take the appearance of annotations. For example we can use "G" for "GCC", "C" for "C11", "k" for "kernel", "k,h" for "kernel, historic", etc.

Quoted 8 lines
Quoted 4 lines

As for words/terms, if you can provide me a wish list you'd like to see in the general index, I'm willing to add such annotations.
My starting point of the general index is the Glossary.

The glossary is a good starting point. People mentioned in the text is another. Not sure whether or not those quoted in the epigraphs should be included or not.

Ah, I missed people's names.

Quoted 6 lines

Names of algorithms should be included, also names
of data structures and of famous problems (for example, the Dining Philosopher's problem, mazes, and so on).

I am sure that I am missing quite a few categories, but at least a start! ;-)

Let me see how it can be done.

I'll submit a [NOT PULL] request when it is ready as PoC.

Thanks, Akira

Quoted 76 lines

Thanx, Paul

Quoted 73 lines

Thoughts?

Quoted 69 lines

Or am I still confused? ;-)

Thanx, Paul

Quoted 64 lines

---
C Lock1-for-herd7

(*
* Example test incompatible with klitmus7
*
* klitmus7 cannot access spinlock_t variable.
*)

{}

P0(int *x, spinlock_t *sp)

{
	spin_lock(sp);
	WRITE_ONCE(*x, 1);
	WRITE_ONCE(*x, 0);
	spin_unlock(sp);
}

P1(int *x, spinlock_t *sp)

{
	int r1;

	spin_lock(sp);
	r1 = READ_ONCE(*x);
	spin_unlock(sp);
}

locations [sp] (* incompatible with klitmus7 *)
exists (1:r1=1)
---

klitmus7 can't convert this to a kernel module:

---

$ klitmus7 -o temp C-Lock1-for-herd7.litmus
File "C-Lock1-for-herd7.litmus" Parameter sp, type mismatch int vs. spinlock_t
---

Actually, herd7/LKMM does complain of this one:

---
Test Lock1-for-herd7 Allowed
States 1
1:r1=0; sp=0;
No
Witnesses
Positive: 0 Negative: 2
Flag lock-final <---
Condition exists (1:r1=1)
Observation Lock1-for-herd7 Never 0 2
Time Lock1-for-herd7 0.01
Hash=5d10e6c355cec0c36f354abf175adc54
---

Comment at line 57 of lock.cat says:

---
(* The final value of a spinlock should not be tested *) flag ~empty [FW] ; loc ; [ALL-LOCKS] as lock-final
---

Thanks, Akira

[...]

#9 lore raw

Re: Index in Perfbook (was Re: [PATCH perfbook 0/2] CodeSamples/formal: Cleanup of init blocks in litmus tests)

Quoted 95 lines · Akira Yokosawa
Quoted 79 lines · Paul E. McKenney
Quoted 57 lines · Akira Yokosawa
Quoted 45 lines · Paul E. McKenney
Quoted 44 lines · Akira Yokosawa
Quoted 43 lines · Paul E. McKenney
Quoted 22 lines · Akira Yokosawa

Hi Paul,

This patch set is what I mentioned the other day in response to your LKMM patch for 5.11.
klitmus7 doesn't need most of type info in litmus-test init blocks.

While there are some cases where klitmus7 requires type info of variables to be watched (via the "exists", "locations", or "filter" directive), as long as the watched variables are of type "int", extra type info in the init block is not required.

Litmus tests under CodeSamples/formal/ should keep compatible with klitmus7 after this patch set is applied.

Patch 1/2 removes initialization to 0 and type info of "int" or "int *" under CodeSamples/formal/litmus/.

Patch 2/2 further reduce line counts of litmus tests by using "{}" as empty init blocks.
It also adds/removes empty lines for those code snippets to have consistent looks.

Quoted 4 lines

Similar changes to patch 1/2 can be made in the RCU litmus tests presented in Section 12.3.2. They are not touched in this patch set.

May be in a follow-up patch.

Queued and pushed, thank you very much!

Quoted 12 lines

Thanks, Akira

*NOTE*:

There are cases where litmus tests for herd7 can not be made compatible with (current) klitmus7, though.

One such example is when a variable of a type other than the "int" or "int *" (such as "spinlock_t") is specified in the "locations" or "filter" directive.
Current klitmus7 has no idea of the way to obtain the value of such a variable.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Good to know! Do we have litmus tests that have problems with this?

One such litmus test can be made up based on CodeSamples/formal/herd/C-Lock1.litmus

So there is not currently such a litmus test in perfbook, but one could easily be created, correct?

You are right!

Thanks, Akira

Quoted 7 lines

PS.

I'm preparing a patch series to add an index framework in perfbook. My plan is to add a specific make target for the time being to have such index pages printed.
As you should know, the hard part is to embed a *lot* of index annotations in .tex source files.

Quite right, it is a big job!

Quoted 4 lines

I'm thinking of splitting indexes into a general one and API index. By API, I mean functions such as smp_mb(), READ_ONCE(), etc.

API index can have kernel API, perfbook specific API, C11 API, and GCC API.

The upside is that the individual indexes are smaller and perhaps more manageable. The downside is that a reader who has no idea what the function call is might have to look it up in four (or maybe even five) indexes. Especially if the API is a historic API that is no longer used.

Quoted 3 lines

I have no idea what the right answer is. One approach would be to have all of the APIs appear both in their respective categories and in the general index. Not sure that this would be any better, though.

My idea is to merge all the APIs into a single API Index. Category of each API can be shown there like:

    __atomic_load() (GCC), <pages>
    ACCESS_ONCE() (kernel, historic), <pages>
    atomic_inc() (kernel), <pages>
    atomic_load() (C11), <pages>
    fork() (POSIX), <pages>
    smp_mb() (kernel), <pages>
    smp_read_barrier_depends() (kernel, historic), <pages>
Quoted 3 lines

Give or take the appearance of annotations. For example we can use "G" for "GCC", "C" for "C11", "k" for "kernel", "k,h" for "kernel, historic", etc.

Ah, that does make more sense, thank you for clarifying!

Quoted 14 lines
Quoted 7 lines
Quoted 3 lines

As for words/terms, if you can provide me a wish list you'd like to see in the general index, I'm willing to add such annotations.
My starting point of the general index is the Glossary.

The glossary is a good starting point. People mentioned in the text is another. Not sure whether or not those quoted in the epigraphs should be included or not.

Ah, I missed people's names.

Quoted 4 lines

Names of algorithms should be included, also names
of data structures and of famous problems (for example, the Dining Philosopher's problem, mazes, and so on).

Quoted 6 lines
Quoted 2 lines

I am sure that I am missing quite a few categories, but at least a start! ;-)

Let me see how it can be done.

I'll submit a [NOT PULL] request when it is ready as PoC.

Sounds very good!

Thanx, Paul

Quoted 78 lines

Thanks, Akira

Quoted 76 lines

Thanx, Paul

Quoted 73 lines

Thoughts?

Quoted 69 lines

Or am I still confused? ;-)

Thanx, Paul

Quoted 64 lines

---
C Lock1-for-herd7

(*
* Example test incompatible with klitmus7
*
* klitmus7 cannot access spinlock_t variable.
*)

{}

P0(int *x, spinlock_t *sp)

{
	spin_lock(sp);
	WRITE_ONCE(*x, 1);
	WRITE_ONCE(*x, 0);
	spin_unlock(sp);
}

P1(int *x, spinlock_t *sp)

{
	int r1;

	spin_lock(sp);
	r1 = READ_ONCE(*x);
	spin_unlock(sp);
}

locations [sp] (* incompatible with klitmus7 *)
exists (1:r1=1)
---

klitmus7 can't convert this to a kernel module:

---

$ klitmus7 -o temp C-Lock1-for-herd7.litmus
File "C-Lock1-for-herd7.litmus" Parameter sp, type mismatch int vs. spinlock_t
---

Actually, herd7/LKMM does complain of this one:

---
Test Lock1-for-herd7 Allowed
States 1
1:r1=0; sp=0;
No
Witnesses
Positive: 0 Negative: 2
Flag lock-final <---
Condition exists (1:r1=1)
Observation Lock1-for-herd7 Never 0 2
Time Lock1-for-herd7 0.01
Hash=5d10e6c355cec0c36f354abf175adc54
---

Comment at line 57 of lock.cat says:

---
(* The final value of a spinlock should not be tested *) flag ~empty [FW] ; loc ; [ALL-LOCKS] as lock-final
---

Thanks, Akira

[...]