Skip to contentSkip to conversation

Documentation: memory-barriers: Fix typo in the first example

PATCH In review Srikanth Thokala 4 participants 8 messages Nov 18, 2014 – Dec 3, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: memory-barriers: Fix typo in the first example

In the first example, the loads into 'x' and 'y' on CPU 2 doesn't match the sequence of events described below it. To match the sequence of events, the values of 'A' and 'B' should be loaded into 'x' and 'y' respectively.

---
 Documentation/memory-barriers.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/memory-barriers.txt +2 -2
index 22a969c..2770bce 100644
@@ -115,8 +115,8 @@ For example, consider the following sequence of events:
 	CPU 1		CPU 2
 	===============	===============
 	{ A == 1; B == 2 }
-	A = 3;		x = B;
-	B = 4;		y = A;
+	A = 3;		x = A;
+	B = 4;		y = B;
 
 The set of accesses as seen by the memory system in the middle can be arranged
 in 24 different combinations:
Signature · 1 line
1.9.1
#1 lore raw

Hi,

Kindly review the patch.

Thanks
Srikanth

Quoted 28 lines · Srikanth Thokala

In the first example, the loads into 'x' and 'y' on CPU 2 doesn't match the sequence of events described below it. To match the sequence of events, the values of 'A' and 'B' should be loaded into 'x' and 'y' respectively.

---
 Documentation/memory-barriers.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/memory-barriers.txt +2 -3
index 22a969c..2770bce 100644
@@ -115,8 +115,8 @@ For example, consider the following sequence of events:
        CPU 1           CPU 2
        =============== ===============
        { A == 1; B == 2 }
-       A = 3;          x = B;
-       B = 4;          y = A;
+       A = 3;          x = A;
+       B = 4;          y = B;
 
 The set of accesses as seen by the memory system in the middle can be arranged
 in 24 different combinations:
--

1.9.1

maintainer
#2 lore raw
Quoted 3 lines · On Thu, 27 Nov 2014 12:19:26 +0530 Srikanth Thokala <[email protected]>…

Hi,

Kindly review the patch.

To me it looks right. Something like this, though, needs an ack from Paul (cc'd) before I can be really confident. Paul...?

jon

Quoted 34 lines

Thanks
Srikanth

Quoted 28 lines · Srikanth Thokala

In the first example, the loads into 'x' and 'y' on CPU 2 doesn't match the sequence of events described below it. To match the sequence of events, the values of 'A' and 'B' should be loaded into 'x' and 'y' respectively.

---
 Documentation/memory-barriers.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/memory-barriers.txt +2 -3
index 22a969c..2770bce 100644
@@ -115,8 +115,8 @@ For example, consider the following sequence of events:
        CPU 1           CPU 2
        =============== ===============
        { A == 1; B == 2 }
-       A = 3;          x = B;
-       B = 4;          y = A;
+       A = 3;          x = A;
+       B = 4;          y = B;
 
 The set of accesses as seen by the memory system in the middle can be arranged
 in 24 different combinations:
--

1.9.1

#3 lore raw
Quoted 9 lines · Jonathan Corbet
Quoted 3 lines · On Thu, 27 Nov 2014 12:19:26 +0530 Srikanth Thokala <[email protected]>…

Hi,

Kindly review the patch.

To me it looks right. Something like this, though, needs an ack from Paul (cc'd) before I can be really confident. Paul...?

I am guessing that this patch is against an old version of this file (there have been two patches applied to this example in the last six months). I believe that the current version is correct, in other words, that Alexey Dobriyan and Pranith Kumar beat you to this one. ;-)

Please see below for the current version, which is in -tip as of November 20th.

Thanx, Paul

Quoted 30 lines

jon

Quoted 28 lines

Thanks
Srikanth

Quoted 23 lines · Srikanth Thokala

In the first example, the loads into 'x' and 'y' on CPU 2 doesn't match the sequence of events described below it. To match the sequence of events, the values of 'A' and 'B' should be loaded into 'x' and 'y' respectively.

---
 Documentation/memory-barriers.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/memory-barriers.txt +2 -2
index 22a969c..2770bce 100644
@@ -115,8 +115,8 @@ For example, consider the following sequence of events:
        CPU 1           CPU 2
        =============== ===============
        { A == 1; B == 2 }
-       A = 3;          x = B;
-       B = 4;          y = A;
+       A = 3;          x = A;
+       B = 4;          y = B;
 
Quoted 2 lines
Quoted 2 lines

Documentation/memory-barriers.txt For example, consider the following sequence of events: · line 122

Quoted 2 lines
Documentation/memory-barriers.txt +0 -0
 The set of accesses as seen by the memory system in the middle can be arranged
 in 24 different combinations:

For example, consider the following sequence of events:

	CPU 1		CPU 2
	===============	===============
	{ A == 1; B == 2 }
	A = 3;		x = B;
	B = 4;		y = A;

The set of accesses as seen by the memory system in the middle can be arranged in 24 different combinations:

	STORE A=3,	STORE B=4,	y=LOAD A->3,	x=LOAD B->4
	STORE A=3,	STORE B=4,	x=LOAD B->4,	y=LOAD A->3
	STORE A=3,	y=LOAD A->3,	STORE B=4,	x=LOAD B->4
	STORE A=3,	y=LOAD A->3,	x=LOAD B->2,	STORE B=4
	STORE A=3,	x=LOAD B->2,	STORE B=4,	y=LOAD A->3
	STORE A=3,	x=LOAD B->2,	y=LOAD A->3,	STORE B=4
	STORE B=4,	STORE A=3,	y=LOAD A->3,	x=LOAD B->4
	STORE B=4, ...
	...

and can thus result in four different combinations of values:

	x == 2, y == 1
	x == 2, y == 3
	x == 4, y == 1
	x == 4, y == 3
maintainer
#4 lore raw
Quoted 4 lines · On Tue, 2 Dec 2014 13:50:06 -0800 "Paul E. McKenney"…

I am guessing that this patch is against an old version of this file (there have been two patches applied to this example in the last six months). I believe that the current version is correct, in other words, that Alexey Dobriyan and Pranith Kumar beat you to this one. ;-)

I thought it looked familiar somehow...patch dropped.

I guess it's comforting to know that so many people are reading that file so closely, but it's a little scary too...:)

Thanks,

jon

#5 lore raw
Quoted 8 lines · Jonathan Corbet
Quoted 4 lines · On Tue, 2 Dec 2014 13:50:06 -0800 "Paul E. McKenney"…

I am guessing that this patch is against an old version of this file (there have been two patches applied to this example in the last six months). I believe that the current version is correct, in other words, that Alexey Dobriyan and Pranith Kumar beat you to this one. ;-)

Quoted 4 lines

I thought it looked familiar somehow...patch dropped.

I guess it's comforting to know that so many people are reading that file so closely, but it's a little scary too...:)

What scares me is that so few people appear to have been reading it earlier on. ;-)

Thanx, Paul

#6 lore raw
Quoted 9 lines · Paul E. McKenney
Quoted 8 lines · Jonathan Corbet
Quoted 4 lines · On Tue, 2 Dec 2014 13:50:06 -0800 "Paul E. McKenney"…

I am guessing that this patch is against an old version of this file (there have been two patches applied to this example in the last six months). I believe that the current version is correct, in other words, that Alexey Dobriyan and Pranith Kumar beat you to this one. ;-)

Quoted 7 lines
Quoted 4 lines

I thought it looked familiar somehow...patch dropped.

I guess it's comforting to know that so many people are reading that file so closely, but it's a little scary too...:)

What scares me is that so few people appear to have been reading it earlier on. ;-)

Or they read it but failed to understand it. Not sure which is scarier.

Those are probably the Evil Vendor Tree developers who apparently think "this is hard, best put volatile and barriers _everywhere_ and hope for the best."

Signature · 2 lines
Måns Rullgård
[email protected]
#7 lore raw
Quoted 16 lines · Måns Rullgård
Quoted 14 lines · Paul E. McKenney
Quoted 12 lines · Jonathan Corbet
Quoted 4 lines · On Tue, 2 Dec 2014 13:50:06 -0800 "Paul E. McKenney"…

I am guessing that this patch is against an old version of this file (there have been two patches applied to this example in the last six months). I believe that the current version is correct, in other words, that Alexey Dobriyan and Pranith Kumar beat you to this one. ;-)

I thought it looked familiar somehow...patch dropped.

I guess it's comforting to know that so many people are reading that file so closely, but it's a little scary too...:)

Quoted 8 lines
Quoted 2 lines

What scares me is that so few people appear to have been reading it earlier on. ;-)

Or they read it but failed to understand it. Not sure which is scarier.

Those are probably the Evil Vendor Tree developers who apparently think "this is hard, best put volatile and barriers _everywhere_ and hope for the best."

"This is hard!!! Let's go do some single-threaded programming!" ;-)

Thanx, Paul