Discussions of the Parallel Programming book
 help / color / mirror / Atom feed
* [PATCH 0/6] advsync: Misc. fixes around litmus tests
@ 2017-07-12 15:07 Akira Yokosawa
  2017-07-12 15:08 ` [PATCH 1/6] advsync: Fix typo of litmus name Akira Yokosawa
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Akira Yokosawa @ 2017-07-12 15:07 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From de45acd5a73354cbe03abaf3130177687c77e4cb Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Wed, 12 Jul 2017 23:45:17 +0900
Subject: [PATCH 0/6] advsync: Misc. fixes around litmus tests

Hi Paul,

This patch set tries to cleanup recently updated material in advsync.

Patches 1 to 3 are fixes of litmus tests under CodeSamples/advsync/herd
and their corresponding snippets in memorybarriers.tex.

Patch 4 is trivial fixes.

Patch 5 is my attempt for the sentence to make sense.

Patch 6 updates the usage of x0 and x1 in the tables of Store-Buffering
Sequence of Events. I stopped short of using READ_ONCE() and WRITE_ONCE()
in the "Instruction" columns. The change seems unnecessary for me.
I think we can assume a reader of this section can easily translate
READ_ONCE() and WRITE_ONCE() to simple assignments in his/her mind.
Also, you are calling x0 and x1 as if they are variables in the text.
But I don't think the current way of description is ambiguous.

So, Patches 1 to 4 should be all right. You might feel otherwise to
Patches 5 and 6.

Thoughts?

            Thanks, Akira
-- 
Akira Yokosawa (6):
  advsync: Fix typo of litmus name
  advsync: Fix typos in load-buffering litmus tests
  advsync: Fix remaining typo in exists condition
  advsync: Trivial typo fixes
  advsync: Fix grammatical error
  advsync: Adjust value expressions in Tables 14.1 and 14.2

 CodeSamples/advsync/herd/C-LB+o-o+o-o.litmus       |   2 +-
 CodeSamples/advsync/herd/C-LB+o-r+a-o.litmus       |   4 +-
 .../advsync/herd/C-MP+o-wmb-o+o-rmb-o.litmus       |   2 +-
 advsync/memorybarriers.tex                         | 103 ++++++++++-----------
 4 files changed, 55 insertions(+), 56 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/6] advsync: Fix typo of litmus name
  2017-07-12 15:07 [PATCH 0/6] advsync: Misc. fixes around litmus tests Akira Yokosawa
@ 2017-07-12 15:08 ` Akira Yokosawa
  2017-07-12 15:10 ` [PATCH 2/6] advsync: Fix typos in load-buffering litmus tests Akira Yokosawa
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2017-07-12 15:08 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From fa84a8b089a721ea67ba631eb76d6b10e1965541 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Wed, 12 Jul 2017 20:09:43 +0900
Subject: [PATCH 1/6] advsync: Fix typo of litmus name

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 CodeSamples/advsync/herd/C-MP+o-wmb-o+o-rmb-o.litmus | 2 +-
 advsync/memorybarriers.tex                           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CodeSamples/advsync/herd/C-MP+o-wmb-o+o-rmb-o.litmus b/CodeSamples/advsync/herd/C-MP+o-wmb-o+o-rmb-o.litmus
index e604eb5..1e92453 100644
--- a/CodeSamples/advsync/herd/C-MP+o-wmb-o+o-rmb-o.litmus
+++ b/CodeSamples/advsync/herd/C-MP+o-wmb-o+o-rmb-o.litmus
@@ -1,4 +1,4 @@
-C C-MP+o-wmb-o+o-o.litmus
+C C-MP+o-wmb-o+o-rmb-o.litmus

 {
 }
diff --git a/advsync/memorybarriers.tex b/advsync/memorybarriers.tex
index a1c3327..a354a54 100644
--- a/advsync/memorybarriers.tex
+++ b/advsync/memorybarriers.tex
@@ -636,7 +636,7 @@ this~\cite{JadeAlglave2011ppcmem}.
 \begin{figure}[tbp]
 { \scriptsize
 \begin{verbbox}
- 1 C C-MP+o-wmb-o+o-o.litmus
+ 1 C C-MP+o-wmb-o+o-rmb-o.litmus
  2
  3 {
  4 }
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/6] advsync: Fix typos in load-buffering litmus tests
  2017-07-12 15:07 [PATCH 0/6] advsync: Misc. fixes around litmus tests Akira Yokosawa
  2017-07-12 15:08 ` [PATCH 1/6] advsync: Fix typo of litmus name Akira Yokosawa
@ 2017-07-12 15:10 ` Akira Yokosawa
  2017-07-12 15:10 ` [PATCH 3/6] advsync: Fix remaining typo in exists condition Akira Yokosawa
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2017-07-12 15:10 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 5fd378b832e773d13db4196c6c8b6145eea00774 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Wed, 12 Jul 2017 20:41:26 +0900
Subject: [PATCH 2/6] advsync: Fix typos in load-buffering litmus tests

Also replace contents of Figure 14.11: Load-Buffering Litmus
Test with the correct one.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 CodeSamples/advsync/herd/C-LB+o-o+o-o.litmus |  2 +-
 CodeSamples/advsync/herd/C-LB+o-r+a-o.litmus |  4 +--
 advsync/memorybarriers.tex                   | 43 ++++++++++++++--------------
 3 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/CodeSamples/advsync/herd/C-LB+o-o+o-o.litmus b/CodeSamples/advsync/herd/C-LB+o-o+o-o.litmus
index 808071f..8ee530d 100644
--- a/CodeSamples/advsync/herd/C-LB+o-o+o-o.litmus
+++ b/CodeSamples/advsync/herd/C-LB+o-o+o-o.litmus
@@ -23,4 +23,4 @@ P1(int *x0, int *x1)
 	WRITE_ONCE(*x1, 2);
 }

-exists (1:r2=1 /\ 0:r2=1)
+exists (1:r2=2 /\ 0:r2=2)
diff --git a/CodeSamples/advsync/herd/C-LB+o-r+a-o.litmus b/CodeSamples/advsync/herd/C-LB+o-r+a-o.litmus
index e171ce5..f1b6dba 100644
--- a/CodeSamples/advsync/herd/C-LB+o-r+a-o.litmus
+++ b/CodeSamples/advsync/herd/C-LB+o-r+a-o.litmus
@@ -1,4 +1,4 @@
-C C-LB+o-mb-o+o-mb-o.litmus
+C C-LB+o-r+a-o.litmus
 {
 }

@@ -23,4 +23,4 @@ P1(int *x0, int *x1)
 	WRITE_ONCE(*x1, 2);
 }

-exists (1:r2=1 /\ 0:r2=1)
+exists (1:r2=2 /\ 0:r2=2)
diff --git a/advsync/memorybarriers.tex b/advsync/memorybarriers.tex
index a354a54..936b95e 100644
--- a/advsync/memorybarriers.tex
+++ b/advsync/memorybarriers.tex
@@ -677,29 +677,28 @@ Figure~\ref{fig:advsync:Enforcing Order of Message-Passing Litmus Test}.
 \begin{figure}[tbp]
 { \scriptsize
 \begin{verbbox}
- 1 C C-MP+o-wmb-o+o-o.litmus
- 2
- 3 {
- 4 }
- 5
- 6 P0(int* x0, int* x1) {
- 7
- 8   WRITE_ONCE(*x0, 2);
- 9   smp_wmb();
-10   WRITE_ONCE(*x1, 2);
-11
-12 }
+ 1 C C-LB+o-o+o-o
+ 2 {
+ 3 }
+ 4
+ 5 P0(int *x0, int *x1)
+ 6 {
+ 7   int r2;
+ 8
+ 9   r2 = READ_ONCE(*x1);
+10   WRITE_ONCE(*x0, 2);
+11 }
+12
 13
-14 P1(int* x0, int* x1) {
-15
+14 P1(int *x0, int *x1)
+15 {
 16   int r2;
-17   int r3;
-18
-19   r2 = READ_ONCE(*x1);
-20   r3 = READ_ONCE(*x0);
+17
+18   r2 = READ_ONCE(*x0);
+19   WRITE_ONCE(*x1, 2);
+20 }
 21
-22 }
-23 exists (1:r2=2 /\ 1:r3=0)
+22 exists (1:r2=2 /\ 0:r2=2)
 \end{verbbox}
 }
 \centering
@@ -719,7 +718,7 @@ reordering~\cite{JadeAlglave2011ppcmem}.
 \begin{figure}[tbp]
 { \scriptsize
 \begin{verbbox}
- 1 C C-LB+o-mb-o+o-mb-o.litmus
+ 1 C C-LB+o-r+a-o.litmus
  2 {
  3 }
  4
@@ -740,7 +739,7 @@ reordering~\cite{JadeAlglave2011ppcmem}.
 19   WRITE_ONCE(*x1, 2);
 20 }
 21
-22 exists (1:r2=1 /\ 0:r2=1)
+22 exists (1:r2=2 /\ 0:r2=2)
 \end{verbbox}
 }
 \centering
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/6] advsync: Fix remaining typo in exists condition
  2017-07-12 15:07 [PATCH 0/6] advsync: Misc. fixes around litmus tests Akira Yokosawa
  2017-07-12 15:08 ` [PATCH 1/6] advsync: Fix typo of litmus name Akira Yokosawa
  2017-07-12 15:10 ` [PATCH 2/6] advsync: Fix typos in load-buffering litmus tests Akira Yokosawa
@ 2017-07-12 15:10 ` Akira Yokosawa
  2017-07-12 15:11 ` [PATCH 4/6] advsync: Trivial typo fixes Akira Yokosawa
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2017-07-12 15:10 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 2dd610086d6a4599dab6287b8e1180bbc3f92f88 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Wed, 12 Jul 2017 21:20:14 +0900
Subject: [PATCH 3/6] advsync: Fix remaining typo in exists condition

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 advsync/memorybarriers.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/advsync/memorybarriers.tex b/advsync/memorybarriers.tex
index 936b95e..10d28f0 100644
--- a/advsync/memorybarriers.tex
+++ b/advsync/memorybarriers.tex
@@ -613,7 +613,7 @@ loads and stores.
 22
 23 }
 24
-25 exists (1:r2=1 /\ 1:r3=0)
+25 exists (1:r2=2 /\ 1:r3=0)
 \end{verbbox}
 }
 \centering
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/6] advsync: Trivial typo fixes
  2017-07-12 15:07 [PATCH 0/6] advsync: Misc. fixes around litmus tests Akira Yokosawa
                   ` (2 preceding siblings ...)
  2017-07-12 15:10 ` [PATCH 3/6] advsync: Fix remaining typo in exists condition Akira Yokosawa
@ 2017-07-12 15:11 ` Akira Yokosawa
  2017-07-12 15:13 ` [PATCH 5/6] advsync: Fix grammatical error Akira Yokosawa
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2017-07-12 15:11 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 4e13865babb05ec6bd0521ae74d523fd562af6ce Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Wed, 12 Jul 2017 22:49:00 +0900
Subject: [PATCH 4/6] advsync: Trivial typo fixes

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 advsync/memorybarriers.tex | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/advsync/memorybarriers.tex b/advsync/memorybarriers.tex
index 10d28f0..b085443 100644
--- a/advsync/memorybarriers.tex
+++ b/advsync/memorybarriers.tex
@@ -670,7 +670,7 @@ this~\cite{JadeAlglave2011ppcmem}.
 \end{figure}

 Therefore, portable code relying on ordering in this case should
-add explicit ordering, for example, the \co{smp_rmb(} shown on
+add explicit ordering, for example, the \co{smp_rmb()} shown on
 line~20 of
 Figure~\ref{fig:advsync:Enforcing Order of Message-Passing Litmus Test}.

@@ -956,7 +956,7 @@ Figure~\ref{fig:advsync:S Address-Dependency Litmus Test}?
 Because no production-quality architecture speculated writes,
 it is not possible for the \co{WRITE_ONCE()} on line~10 to overwrite
 the \co{WRITE_ONCE()} on line~21, meaning that the \co{exists}
-clause on line`25 cannot be satisfied, even on DEC Alpha, even
+clause on line~25 cannot be satisfied, even on DEC Alpha, even
 without the \co{lockless_dereference()} that is required in the
 dependent-read case.

-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/6] advsync: Fix grammatical error
  2017-07-12 15:07 [PATCH 0/6] advsync: Misc. fixes around litmus tests Akira Yokosawa
                   ` (3 preceding siblings ...)
  2017-07-12 15:11 ` [PATCH 4/6] advsync: Trivial typo fixes Akira Yokosawa
@ 2017-07-12 15:13 ` Akira Yokosawa
  2017-07-12 15:14 ` [PATCH 6/6] advsync: Adjust value expressions in Tables 14.1 and 14.2 Akira Yokosawa
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2017-07-12 15:13 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From b97b1a0383b55fb5202e4799f2c1dafe576de5ee Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Wed, 12 Jul 2017 22:50:16 +0900
Subject: [PATCH 5/6] advsync: Fix grammatical error

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 advsync/memorybarriers.tex | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/advsync/memorybarriers.tex b/advsync/memorybarriers.tex
index b085443..8693cac 100644
--- a/advsync/memorybarriers.tex
+++ b/advsync/memorybarriers.tex
@@ -847,9 +847,9 @@ instruction.

 Figure~\ref{fig:advsync:Message-Passing Address-Dependency Litmus Test}
 shows a linked variant of the message-passing pattern.
-The head pointer is \co{x1}, which is initially
+The head pointer is \co{x1}, which initially
 references the \co{int} variable \co{y} (line~5), which is in turn 
-is initialized to the value $1$ (line~4).
+initialized to the value $1$ (line~4).

 \co{P0()} updates head pointer \co{x1} to reference \co{x0} (line~12),
 but only afer initializing it to $2$ (line~10) and forcing ordering
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/6] advsync: Adjust value expressions in Tables 14.1 and 14.2
  2017-07-12 15:07 [PATCH 0/6] advsync: Misc. fixes around litmus tests Akira Yokosawa
                   ` (4 preceding siblings ...)
  2017-07-12 15:13 ` [PATCH 5/6] advsync: Fix grammatical error Akira Yokosawa
@ 2017-07-12 15:14 ` Akira Yokosawa
  2017-07-13 13:38 ` [PATCH 7/6] advsync: Catch up changes in litmus tests Akira Yokosawa
  2017-07-13 18:03 ` [PATCH 0/6] advsync: Misc. fixes around " Paul E. McKenney
  7 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2017-07-12 15:14 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From de45acd5a73354cbe03abaf3130177687c77e4cb Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Wed, 12 Jul 2017 23:21:52 +0900
Subject: [PATCH 6/6] advsync: Adjust value expressions in Tables 14.1 and 14.2

As x0 and x1 are pointers, they should be in dereferenced form.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 advsync/memorybarriers.tex | 48 +++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/advsync/memorybarriers.tex b/advsync/memorybarriers.tex
index 8693cac..b9dd1fa 100644
--- a/advsync/memorybarriers.tex
+++ b/advsync/memorybarriers.tex
@@ -179,7 +179,7 @@ Figure~\ref{fig:advsync:Memory Misordering: Store-Buffering Litmus Test}.

 \begin{table*}
 \small
-\centering\OneColumnHSpace{-.1in}
+\centering\OneColumnHSpace{-.2in}
 \begin{tabular}{r||l|l|l||l|l|l}
 	& \multicolumn{3}{c||}{CPU 0} & \multicolumn{3}{c}{CPU 1} \\
 	\cline{2-7}
@@ -187,20 +187,20 @@ Figure~\ref{fig:advsync:Memory Misordering: Store-Buffering Litmus Test}.
 		Instruction & Store Buffer & Cache \\
 	\hline
 	\hline
-	1 & (Initial state) & & \tco{x1==0} &
-		(Initial state) & & \tco{x0==0} \\
+	1 & (Initial state) & & \tco{*x1==0} &
+		(Initial state) & & \tco{*x0==0} \\
 	\hline
-	2 & \tco{*x0 = 2} & \tco{x0==2} & \tco{x1==0} &
-		\tco{*x1 = 2;} & \tco{x1==2} & \tco{x0==0} \\
+	2 & \tco{*x0 = 2;} & \tco{*x0==2} & \tco{*x1==0} &
+		\tco{*x1 = 2;} & \tco{*x1==2} & \tco{*x0==0} \\
 	\hline
-	3 & \tco{r2 = *x1;} (0) & \tco{x0==2} & \tco{x1==0} &
-		\tco{r2 = *x0;} (0) & \tco{x1==2} & \tco{x0==0} \\
+	3 & \tco{r2 = *x1;} (0) & \tco{*x0==2} & \tco{*x1==0} &
+		\tco{r2 = *x0;} (0) & \tco{*x1==2} & \tco{*x0==0} \\
 	\hline
-	4 & (Read-invalidate) & \tco{x0==2} & \tco{x0==0} &
-		(Read-invalidate) & \tco{x1==2} & \tco{x1==0} \\
+	4 & (Read-invalidate) & \tco{*x0==2} & \tco{*x0==0} &
+		(Read-invalidate) & \tco{*x1==2} & \tco{*x1==0} \\
 	\hline
-	5 & (Finish store) & & \tco{x0==2} &
-		(Finish store) & & \tco{x1==2} \\
+	5 & (Finish store) & & \tco{*x0==2} &
+		(Finish store) & & \tco{*x1==2} \\
 \end{tabular}
 \caption{Memory Misordering: Store-Buffering Sequence of Events}
 \label{tab:advsync:Memory Misordering: Store-Buffering Sequence of Events}
@@ -343,7 +343,7 @@ Figure~\ref{fig:advsync:Memory Misordering: Store-Buffering Litmus Test}.

 \begin{table*}
 \small
-\centering\OneColumnHSpace{-0.75in}
+\centering\OneColumnHSpace{-0.2in}
 \begin{tabular}{r||l|l|l||l|l|l}
 	& \multicolumn{3}{c||}{CPU 0} & \multicolumn{3}{c}{CPU 1} \\
 	\cline{2-7}
@@ -351,23 +351,23 @@ Figure~\ref{fig:advsync:Memory Misordering: Store-Buffering Litmus Test}.
 		Instruction & Store Buffer & Cache \\
 	\hline
 	\hline
-	1 & (Initial state) & & \tco{x1==0} &
-		(Initial state) & & \tco{x0==0} \\
+	1 & (Initial state) & & \tco{*x1==0} &
+		(Initial state) & & \tco{*x0==0} \\
 	\hline
-	2 & \tco{*x0 = 2} & \tco{x0==2} & \tco{x1==0} &
-		\tco{*x1 = 2;} & \tco{x1==2} & \tco{x0==0} \\
+	2 & \tco{*x0 = 2;} & \tco{*x0==2} & \tco{*x1==0} &
+		\tco{*x1 = 2;} & \tco{*x1==2} & \tco{*x0==0} \\
 	\hline
-	3 & \tco{smp_mb()} & \tco{x0==2} & \tco{x1==0} &
-		\tco{smp_mb()} & \tco{x1==2} & \tco{x0==0} \\
+	3 & \tco{smp_mb();} & \tco{*x0==2} & \tco{*x1==0} &
+		\tco{smp_mb();} & \tco{*x1==2} & \tco{*x0==0} \\
 	\hline
-	4 & (Read-invalidate) & \tco{x0==2} & \tco{x0==0} &
-		(Read-invalidate) & \tco{x1==2} & \tco{x1==0} \\
+	4 & (Read-invalidate) & \tco{*x0==2} & \tco{*x0==0} &
+		(Read-invalidate) & \tco{*x1==2} & \tco{*x1==0} \\
 	\hline
-	5 & (Finish store) & & \tco{x0==2} &
-		(Finish store) & & \tco{x1==2} \\
+	5 & (Finish store) & & \tco{*x0==2} &
+		(Finish store) & & \tco{*x1==2} \\
 	\hline
-	6 & \tco{r2 = *x1;} (2) & & \tco{x1==2} &
-		\tco{r2 = *x0;} (2) & & \tco{x0==2} \\
+	6 & \tco{r2 = *x1;} (2) & & \tco{*x1==2} &
+		\tco{r2 = *x0;} (2) & & \tco{*x0==2} \\
 \end{tabular}
 \caption{Memory Ordering: Store-Buffering Sequence of Events}
 \label{tab:advsync:Memory Ordering: Store-Buffering Sequence of Events}
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/6] advsync: Catch up changes in litmus tests
  2017-07-12 15:07 [PATCH 0/6] advsync: Misc. fixes around litmus tests Akira Yokosawa
                   ` (5 preceding siblings ...)
  2017-07-12 15:14 ` [PATCH 6/6] advsync: Adjust value expressions in Tables 14.1 and 14.2 Akira Yokosawa
@ 2017-07-13 13:38 ` Akira Yokosawa
  2017-07-13 18:03 ` [PATCH 0/6] advsync: Misc. fixes around " Paul E. McKenney
  7 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2017-07-13 13:38 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 9a30f29d248fbe1e6a7b25f2af2b233889639837 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Thu, 13 Jul 2017 21:43:43 +0900
Subject: [PATCH 7/6] advsync: Catch up changes in litmus tests

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
Hi Paul,

This patch is a followup to the previous patch set.
It won't conflict with any one in the set.

       Thanks, Akira
--
 advsync/memorybarriers.tex | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/advsync/memorybarriers.tex b/advsync/memorybarriers.tex
index a1c3327..4d81d44 100644
--- a/advsync/memorybarriers.tex
+++ b/advsync/memorybarriers.tex
@@ -23,8 +23,8 @@ RCU.
  6 {
  7   int r2;
  8
- 9   WRITE_ONCE(x0, 2);
-10   r2 = READ_ONCE(x1);
+ 9   WRITE_ONCE(*x0, 2);
+10   r2 = READ_ONCE(*x1);
 11 }
 12
 13
@@ -32,8 +32,8 @@ RCU.
 15 {
 16   int r2;
 17
-18   WRITE_ONCE(x1, 2);
-19   r2 = READ_ONCE(x0);
+18   WRITE_ONCE(*x1, 2);
+19   r2 = READ_ONCE(*x0);
 20 }
 21
 22 exists (1:r2=0 /\ 0:r2=0)
@@ -293,9 +293,9 @@ thus allowing you to stop reading this section.
  6 {
  7   int r2;
  8
- 9   WRITE_ONCE(x0, 2);
+ 9   WRITE_ONCE(*x0, 2);
 10   smp_mb();
-11   r2 = READ_ONCE(x1);
+11   r2 = READ_ONCE(*x1);
 12 }
 13
 14
@@ -303,9 +303,9 @@ thus allowing you to stop reading this section.
 16 {
 17   int r2;
 18
-19   WRITE_ONCE(x1, 2);
+19   WRITE_ONCE(*x1, 2);
 20   smp_mb();
-21   r2 = READ_ONCE(x0);
+21   r2 = READ_ONCE(*x0);
 22 }
 23
 24 exists (1:r2=0 /\ 0:r2=0)
@@ -598,7 +598,7 @@ loads and stores.
  7 P0(int* x0, int* x1) {
  8
  9   WRITE_ONCE(*x0, 2);
-10   smp_mb();
+10   smp_wmb();
 11   WRITE_ONCE(*x1, 2);
 12
 13 }
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] advsync: Misc. fixes around litmus tests
  2017-07-12 15:07 [PATCH 0/6] advsync: Misc. fixes around litmus tests Akira Yokosawa
                   ` (6 preceding siblings ...)
  2017-07-13 13:38 ` [PATCH 7/6] advsync: Catch up changes in litmus tests Akira Yokosawa
@ 2017-07-13 18:03 ` Paul E. McKenney
  2017-07-13 18:12   ` Paul E. McKenney
  7 siblings, 1 reply; 10+ messages in thread
From: Paul E. McKenney @ 2017-07-13 18:03 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Thu, Jul 13, 2017 at 12:07:18AM +0900, Akira Yokosawa wrote:
> >From de45acd5a73354cbe03abaf3130177687c77e4cb Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Wed, 12 Jul 2017 23:45:17 +0900
> Subject: [PATCH 0/6] advsync: Misc. fixes around litmus tests
> 
> Hi Paul,
> 
> This patch set tries to cleanup recently updated material in advsync.
> 
> Patches 1 to 3 are fixes of litmus tests under CodeSamples/advsync/herd
> and their corresponding snippets in memorybarriers.tex.
> 
> Patch 4 is trivial fixes.
> 
> Patch 5 is my attempt for the sentence to make sense.
> 
> Patch 6 updates the usage of x0 and x1 in the tables of Store-Buffering
> Sequence of Events. I stopped short of using READ_ONCE() and WRITE_ONCE()
> in the "Instruction" columns. The change seems unnecessary for me.
> I think we can assume a reader of this section can easily translate
> READ_ONCE() and WRITE_ONCE() to simple assignments in his/her mind.
> Also, you are calling x0 and x1 as if they are variables in the text.
> But I don't think the current way of description is ambiguous.
> 
> So, Patches 1 to 4 should be all right. You might feel otherwise to
> Patches 5 and 6.

Good catches, thank you!!!

The only think I didn't take was the addition of indirection to the
variables in the tables.  The litmus tests have the indirection on
the function parameters, and omit it in the exists clause.  So there
is potential for confusion either way.  So I came down on the side of
the shortest way, that is, omitting the indirection.

And yes, my original tables were inconsistent!  ;-)

I also took your 7/6 patch, and thank you again.

							Thanx, Paul

> Thoughts?
> 
>             Thanks, Akira
> -- 
> Akira Yokosawa (6):
>   advsync: Fix typo of litmus name
>   advsync: Fix typos in load-buffering litmus tests
>   advsync: Fix remaining typo in exists condition
>   advsync: Trivial typo fixes
>   advsync: Fix grammatical error
>   advsync: Adjust value expressions in Tables 14.1 and 14.2
> 
>  CodeSamples/advsync/herd/C-LB+o-o+o-o.litmus       |   2 +-
>  CodeSamples/advsync/herd/C-LB+o-r+a-o.litmus       |   4 +-
>  .../advsync/herd/C-MP+o-wmb-o+o-rmb-o.litmus       |   2 +-
>  advsync/memorybarriers.tex                         | 103 ++++++++++-----------
>  4 files changed, 55 insertions(+), 56 deletions(-)
> 
> -- 
> 2.7.4
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] advsync: Misc. fixes around litmus tests
  2017-07-13 18:03 ` [PATCH 0/6] advsync: Misc. fixes around " Paul E. McKenney
@ 2017-07-13 18:12   ` Paul E. McKenney
  0 siblings, 0 replies; 10+ messages in thread
From: Paul E. McKenney @ 2017-07-13 18:12 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Thu, Jul 13, 2017 at 11:03:43AM -0700, Paul E. McKenney wrote:
> On Thu, Jul 13, 2017 at 12:07:18AM +0900, Akira Yokosawa wrote:
> > >From de45acd5a73354cbe03abaf3130177687c77e4cb Mon Sep 17 00:00:00 2001
> > From: Akira Yokosawa <akiyks@gmail.com>
> > Date: Wed, 12 Jul 2017 23:45:17 +0900
> > Subject: [PATCH 0/6] advsync: Misc. fixes around litmus tests
> > 
> > Hi Paul,
> > 
> > This patch set tries to cleanup recently updated material in advsync.
> > 
> > Patches 1 to 3 are fixes of litmus tests under CodeSamples/advsync/herd
> > and their corresponding snippets in memorybarriers.tex.
> > 
> > Patch 4 is trivial fixes.
> > 
> > Patch 5 is my attempt for the sentence to make sense.
> > 
> > Patch 6 updates the usage of x0 and x1 in the tables of Store-Buffering
> > Sequence of Events. I stopped short of using READ_ONCE() and WRITE_ONCE()
> > in the "Instruction" columns. The change seems unnecessary for me.
> > I think we can assume a reader of this section can easily translate
> > READ_ONCE() and WRITE_ONCE() to simple assignments in his/her mind.
> > Also, you are calling x0 and x1 as if they are variables in the text.
> > But I don't think the current way of description is ambiguous.
> > 
> > So, Patches 1 to 4 should be all right. You might feel otherwise to
> > Patches 5 and 6.
> 
> Good catches, thank you!!!
> 
> The only think I didn't take was the addition of indirection to the
> variables in the tables.  The litmus tests have the indirection on
> the function parameters, and omit it in the exists clause.  So there
> is potential for confusion either way.  So I came down on the side of
> the shortest way, that is, omitting the indirection.
> 
> And yes, my original tables were inconsistent!  ;-)
> 
> I also took your 7/6 patch, and thank you again.

And kernel.org is having some issues, so I pushed to my github
perfbook repo.  Hopefully kernel.org will be feeling better later...

							Thanx, Paul

> > Thoughts?
> > 
> >             Thanks, Akira
> > -- 
> > Akira Yokosawa (6):
> >   advsync: Fix typo of litmus name
> >   advsync: Fix typos in load-buffering litmus tests
> >   advsync: Fix remaining typo in exists condition
> >   advsync: Trivial typo fixes
> >   advsync: Fix grammatical error
> >   advsync: Adjust value expressions in Tables 14.1 and 14.2
> > 
> >  CodeSamples/advsync/herd/C-LB+o-o+o-o.litmus       |   2 +-
> >  CodeSamples/advsync/herd/C-LB+o-r+a-o.litmus       |   4 +-
> >  .../advsync/herd/C-MP+o-wmb-o+o-rmb-o.litmus       |   2 +-
> >  advsync/memorybarriers.tex                         | 103 ++++++++++-----------
> >  4 files changed, 55 insertions(+), 56 deletions(-)
> > 
> > -- 
> > 2.7.4
> > 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-07-13 18:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12 15:07 [PATCH 0/6] advsync: Misc. fixes around litmus tests Akira Yokosawa
2017-07-12 15:08 ` [PATCH 1/6] advsync: Fix typo of litmus name Akira Yokosawa
2017-07-12 15:10 ` [PATCH 2/6] advsync: Fix typos in load-buffering litmus tests Akira Yokosawa
2017-07-12 15:10 ` [PATCH 3/6] advsync: Fix remaining typo in exists condition Akira Yokosawa
2017-07-12 15:11 ` [PATCH 4/6] advsync: Trivial typo fixes Akira Yokosawa
2017-07-12 15:13 ` [PATCH 5/6] advsync: Fix grammatical error Akira Yokosawa
2017-07-12 15:14 ` [PATCH 6/6] advsync: Adjust value expressions in Tables 14.1 and 14.2 Akira Yokosawa
2017-07-13 13:38 ` [PATCH 7/6] advsync: Catch up changes in litmus tests Akira Yokosawa
2017-07-13 18:03 ` [PATCH 0/6] advsync: Misc. fixes around " Paul E. McKenney
2017-07-13 18:12   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox