Skip to contentSkip to conversation

Updates to Chapter memorder

PATCH In review Junchang Wang 3 participants 9 messages Nov 4, 2018 – Nov 6, 2018

lore
Share & tools
lore
#0 lore raw

cover Updates to Chapter memorder

Hi Paul and Akira,

I have read through the first half of Chapter memorder, and here is correction for a few typos. Please take a look.

For the first patch, the last clause I modified still looks confusion to me. Currently the clause is "though only if both \co{r1} and \co{r3} both end up containing the address of \co{x}"; however, my understanding is that prior load or store would also be ordered before the store on line 16, __only if r1 ends up containing the address of x__. That is, it is not necessary to involve r2/r3. Is my understanding correct? Or did I miss anything about this in the book?

Thanks,
--Junchang

Junchang Wang (2):
memorder: fix typo
memorybarriercum.svg: fix typo

 memorder/memorder.tex         | 8 ++++----
 memorder/memorybarriercum.svg | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 memorder: fix typo

Fix typos in memorder.tex.

---
 memorder/memorder.tex | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
memorder/memorder.tex +4 -4
index 8e11e92..a478f60 100644
@@ -1364,7 +1364,7 @@ The head pointer is \co{x1}, which initially
 references the \co{int} variable \co{y} (line~5), which is in turn
 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
+but only after initializing it to $2$ (line~10) and forcing ordering
 (line~11).
 \co{P1()} picks up the head pointer \co{x1} (line~21), and then loads
 the referenced value (line~22).
@@ -2294,9 +2294,9 @@ These ordering constraints are depicted graphically in
 Figure~\ref{fig:memorder:Cumulativity}.
 Note also that cumulativity is not limited to a single step back in time.
 If there was another load from \co{x} or store to \co{x} from any thread
-that came before the store on line~13, that prior load or store would also
-be ordered before the store on line~32, though only if both \co{r1} and
-\co{r2} both end up containing the address of \co{x}.
+that came before the store on line~8, that prior load or store would also
+be ordered before the store on line~16, though only if both \co{r1} and
+\co{r3} both end up containing the address of \co{x}.
 
 In short, use of cumulative ordering operations can suppress
 non-multicopy-atomic behaviors in some situations.
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 1/2] memorder: fix typo

Quoted 3 lines · Junchang Wang

Fix typos in memorder.tex.

You know, I have no idea what litmus test I was describing in that paragraph, but it certainly wasn't the one in Listing 15.17. :-/

I adjusted things a bit more, so please see below and let me know if I messed anything up.

Thanx, Paul

------------------------------------------------------------------------

commit 73f0f6583b154f2cd9280f321e87dcaabe6b1221

Author: Junchang Wang <[email protected]>
Date:   Sun Nov 4 19:18:38 2018 +0800

memorder: Fix typo

Fix typos in memorder.tex, including a very confused paragraph that seems to be referring to some prior version of Listing 15.17.

[ paulmck: Adjusted rewording of Listing 15.17 discussion. ]
memorder/memorder.tex +4 -4
index 8e11e92153e0..5e74a912e15d 100644
@@ -1364,7 +1364,7 @@ The head pointer is \co{x1}, which initially
 references the \co{int} variable \co{y} (line~5), which is in turn
 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
+but only after initializing it to $2$ (line~10) and forcing ordering
 (line~11).
 \co{P1()} picks up the head pointer \co{x1} (line~21), and then loads
 the referenced value (line~22).
@@ -2294,9 +2294,9 @@ These ordering constraints are depicted graphically in
 Figure~\ref{fig:memorder:Cumulativity}.
 Note also that cumulativity is not limited to a single step back in time.
 If there was another load from \co{x} or store to \co{x} from any thread
-that came before the store on line~13, that prior load or store would also
-be ordered before the store on line~32, though only if both \co{r1} and
-\co{r2} both end up containing the address of \co{x}.
+that came before the store on line~8, that prior load or store would also
+be ordered before the load on line~25, though only if both \co{r1} and
+\co{r2} both end up containing the value \co{1}.
 
 In short, use of cumulative ordering operations can suppress
 non-multicopy-atomic behaviors in some situations.
#3 lore raw

Re: [PATCH 1/2] memorder: fix typo

Quoted 43 lines · Paul E. McKenney
Quoted 3 lines · Junchang Wang

Fix typos in memorder.tex.

You know, I have no idea what litmus test I was describing in that paragraph, but it certainly wasn't the one in Listing 15.17. :-/

I adjusted things a bit more, so please see below and let me know if I messed anything up.

Thanx, Paul

------------------------------------------------------------------------

commit 73f0f6583b154f2cd9280f321e87dcaabe6b1221

Author: Junchang Wang <[email protected]>
Date:   Sun Nov 4 19:18:38 2018 +0800

memorder: Fix typo

Fix typos in memorder.tex, including a very confused paragraph that seems to be referring to some prior version of Listing 15.17.

[ paulmck: Adjusted rewording of Listing 15.17 discussion. ]
memorder/memorder.tex +1 -1
index 8e11e92153e0..5e74a912e15d 100644
@@ -1364,7 +1364,7 @@ The head pointer is \co{x1}, which initially
 references the \co{int} variable \co{y} (line~5), which is in turn
 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
+but only after initializing it to $2$ (line~10) and forcing ordering
 (line~11).
 \co{P1()} picks up the head pointer \co{x1} (line~21), and then loads
 the referenced value (line~22).

memorder/memorder.tex These ordering constraints are depicted graphically in · line 2300

Quoted 10 lines
memorder/memorder.tex +3 -3
@@ -2294,9 +2294,9 @@ These ordering constraints are depicted graphically in
 Figure~\ref{fig:memorder:Cumulativity}.
 Note also that cumulativity is not limited to a single step back in time.
 If there was another load from \co{x} or store to \co{x} from any thread
-that came before the store on line~13, that prior load or store would also
-be ordered before the store on line~32, though only if both \co{r1} and
-\co{r2} both end up containing the address of \co{x}.
+that came before the store on line~8, that prior load or store would also
+be ordered before the load on line~25, though only if both \co{r1} and
+\co{r2} both end up containing the value \co{1}.
 

Hi Paul,

Now the discussion is pretty clear to me. Thanks a lot.

Regards,
--Junchang

Quoted 3 lines
memorder/memorder.tex +0 -0
 In short, use of cumulative ordering operations can suppress
 non-multicopy-atomic behaviors in some situations.
#4 lore raw

PATCH 2/2 memorybarriercum.svg: fix typo

In reply to Junchang Wang

Fix typo in memorybarriercum.svg.

---
 memorder/memorybarriercum.svg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
memorder/memorybarriercum.svg +1 -1
index ac9e5cf..71b69a5 100644
@@ -212,7 +212,7 @@
              id="tspan5462-5"
              y="-981.5686"
              x="-13.718384"
-             sodipodi:role="line">... cumulativity guarantees CPU 0's store before CPU 2's store</tspan></text>
+             sodipodi:role="line">... cumulativity guarantees CPU 0's store before CPU 1's store</tspan></text>
       </g>
       <g
          transform="translate(0,53.92809)"
Signature · 1 line
2.7.4
#5 lore raw

Re: [PATCH 2/2] memorybarriercum.svg: fix typo

Quoted 3 lines · Junchang Wang

Fix typo in memorybarriercum.svg.

Good catch, applied and queued, thank you!

Thanx, Paul

Quoted 20 lines
---
 memorder/memorybarriercum.svg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
memorder/memorybarriercum.svg +1 -1
index ac9e5cf..71b69a5 100644
@@ -212,7 +212,7 @@
              id="tspan5462-5"
              y="-981.5686"
              x="-13.718384"
-             sodipodi:role="line">... cumulativity guarantees CPU 0's store before CPU 2's store</tspan></text>
+             sodipodi:role="line">... cumulativity guarantees CPU 0's store before CPU 1's store</tspan></text>
       </g>
       <g
          transform="translate(0,53.92809)"
Signature · 1 line
2.7.4
#6 lore raw
In reply to Junchang Wang
Quoted 11 lines · Junchang Wang

Hi Paul and Akira,

I have read through the first half of Chapter memorder, and here is correction for a few typos. Please take a look.

For the first patch, the last clause I modified still looks confusion to me. Currently the clause is "though only if both \co{r1} and \co{r3} both end up containing the address of \co{x}"; however, my understanding is that prior load or store would also be ordered before the store on line 16, __only if r1 ends up containing the address of x__. That is, it is not necessary to involve r2/r3. Is my understanding correct? Or did I miss anything about this in the book?

Going back to commit 43236beadb19 ("memorder: Expand on cumulativity and {other,} multicopy atomicity"), this paragraph discussed Listing 14.17 at the time (WWC Litmus Test With Release), which is a different litmus test than the current Listing 15.17 (WRC Litmus Test With Release). Still line 32 of then Listing 14.17 was an "exists" clause. No wonder you can't figure out what is discussed there.

Paul, can you look into this?

Thanks, Akira

Quoted 13 lines

Thanks,
--Junchang

Junchang Wang (2):
memorder: fix typo
memorybarriercum.svg: fix typo

 memorder/memorder.tex         | 8 ++++----
 memorder/memorybarriercum.svg | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
#7 lore raw
Quoted 13 lines · Akira Yokosawa
Quoted 11 lines · Junchang Wang

Hi Paul and Akira,

I have read through the first half of Chapter memorder, and here is correction for a few typos. Please take a look.

For the first patch, the last clause I modified still looks confusion to me. Currently the clause is "though only if both \co{r1} and \co{r3} both end up containing the address of \co{x}"; however, my understanding is that prior load or store would also be ordered before the store on line 16, __only if r1 ends up containing the address of x__. That is, it is not necessary to involve r2/r3. Is my understanding correct? Or did I miss anything about this in the book?

Quoted 8 lines

Going back to commit 43236beadb19 ("memorder: Expand on cumulativity and {other,} multicopy atomicity"), this paragraph discussed Listing 14.17 at the time (WWC Litmus Test With Release), which is a different litmus test than the current Listing 15.17 (WRC Litmus Test With Release). Still line 32 of then Listing 14.17 was an "exists" clause. No wonder you can't figure out what is discussed there.

Paul, can you look into this?

Indeed, this was quite the mess! Hopefully now fixed. ;-)

Thanx, Paul

Quoted 16 lines

Thanks, Akira

Quoted 13 lines

Thanks,
--Junchang

Junchang Wang (2):
memorder: fix typo
memorybarriercum.svg: fix typo

 memorder/memorder.tex         | 8 ++++----
 memorder/memorybarriercum.svg | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
#8 lore raw
Quoted 22 lines · Paul E. McKenney
Quoted 20 lines · Akira Yokosawa
Quoted 11 lines · Junchang Wang

Hi Paul and Akira,

I have read through the first half of Chapter memorder, and here is correction for a few typos. Please take a look.

For the first patch, the last clause I modified still looks confusion to me. Currently the clause is "though only if both \co{r1} and \co{r3} both end up containing the address of \co{x}"; however, my understanding is that prior load or store would also be ordered before the store on line 16, __only if r1 ends up containing the address of x__. That is, it is not necessary to involve r2/r3. Is my understanding correct? Or did I miss anything about this in the book?

Going back to commit 43236beadb19 ("memorder: Expand on cumulativity and {other,} multicopy atomicity"), this paragraph discussed Listing 14.17 at the time (WWC Litmus Test With Release), which is a different litmus test than the current Listing 15.17 (WRC Litmus Test With Release). Still line 32 of then Listing 14.17 was an "exists" clause. No wonder you can't figure out what is discussed there.

Quoted 4 lines
Quoted 1 line

Paul, can you look into this?

Indeed, this was quite the mess! Hopefully now fixed. ;-)

Great! Thanks to both of you :-).

Cheers,
--Junchang

Quoted 19 lines

Thanx, Paul

Quoted 16 lines

Thanks, Akira

Quoted 13 lines

Thanks,
--Junchang

Junchang Wang (2):
memorder: fix typo
memorybarriercum.svg: fix typo

 memorder/memorder.tex         | 8 ++++----
 memorder/memorybarriercum.svg | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)