CodeSamples/formal: Cleanup of init blocks in litmus tests
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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 2/2 CodeSamples/formal: Use '{}' for empty init blocks in litmus tests
In reply to Akira YokosawaFrom 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -1,6 +1,6 @@ C C-cmpxchg -{ -} + +{} { #include "api.h"
Signature · 1 line
2.17.1
Paul E. McKenney
AppliedQuoted 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 testsCodeSamples/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
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 testsCodeSamples/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
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 accessspinlock_tvariable.
*){}
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 testsCodeSamples/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
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 accessspinlock_tvariable.
*){}
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 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 accessspinlock_tvariable.
*){}
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
[...]
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 accessspinlock_tvariable.
*){}
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
[...]
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 accessspinlock_tvariable.
*){}
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
[...]