Skip to contentSkip to conversation

memory-barriers.txt: Fix typo in pairing example

PATCH Applied Scott Tsai 2 participants 2 messages Sep 19, 2017

Subsystems (2)
lore
Share & tools
lore

Scott Tsai

author
#0 lore raw

PATCH 1/1 memory-barriers.txt: Fix typo in pairing example

In the "general barrier pairing with implicit control depdendency" example, the last write by CPU 1 was meant to change variable x and not y. The example would be pretty uninteresting if no CPU ever changes x and the variable was initialized to zero.

---
 Documentation/memory-barriers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/memory-barriers.txt +1 -1
index b759a60624fd..468894a705a9 100644
@@ -968,7 +968,7 @@ Or even:
 	===============	      ===============================
 	r1 = READ_ONCE(y);
 	<general barrier>
-	WRITE_ONCE(y, 1);     if (r2 = READ_ONCE(x)) {
+	WRITE_ONCE(x, 1);     if (r2 = READ_ONCE(x)) {
 			         <implicit control dependency>
 			         WRITE_ONCE(y, 1);
 			      }
Signature · 1 line
2.13.5
#1 lore raw
Quoted 6 lines · Scott Tsai

In the "general barrier pairing with implicit control depdendency" example, the last write by CPU 1 was meant to change variable x and not y. The example would be pretty uninteresting if no CPU ever changes x and the variable was initialized to zero.

Queued for review, thank you!!!

Thanx, Paul

Quoted 20 lines
---
 Documentation/memory-barriers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/memory-barriers.txt +1 -1
index b759a60624fd..468894a705a9 100644
@@ -968,7 +968,7 @@ Or even:
 	===============	      ===============================
 	r1 = READ_ONCE(y);
 	<general barrier>
-	WRITE_ONCE(y, 1);     if (r2 = READ_ONCE(x)) {
+	WRITE_ONCE(x, 1);     if (r2 = READ_ONCE(x)) {
 			         <implicit control dependency>
 			         WRITE_ONCE(y, 1);
 			      }
Signature · 1 line
2.13.5