Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1735143

[PATCH] memory-barriers.txt: Fix typo in pairing example

From Scott Tsai <scottt@scottt.tw>
Newsgroups linux.kernel
Subject [PATCH] memory-barriers.txt: Fix typo in pairing example
Date 2017-09-19 20:20 +0200
Message-ID <urvhL-nD-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Signed-off-by: Scott Tsai <scottt@scottt.tw>
---
 Documentation/memory-barriers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index b759a60624fd..468894a705a9 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -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);
 			      }
-- 
2.13.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] memory-barriers.txt: Fix typo in pairing example Scott Tsai <scottt@scottt.tw> - 2017-09-19 20:20 +0200
  Re: [PATCH] memory-barriers.txt: Fix typo in pairing example "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-09-20 01:00 +0200

csiph-web