[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1407797503-24727-2-git-send-email-bobby.prani@gmail.com>
Date: Mon, 11 Aug 2014 18:51:40 -0400
From: Pranith Kumar <bobby.prani@...il.com>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Josh Triplett <josh@...htriplett.org>,
David Howells <dhowells@...hat.com>,
Masanari Iida <standby24x7@...il.com>,
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] doc: memory-barriers.txt: Add barrier() to provide ordering
In the provably false case, add barrier() in both the legs of the if() condition
to provide ordering.
Signed-off-by: Pranith Kumar <bobby.prani@...il.com>
---
Documentation/memory-barriers.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 41a6c9c..0f2903f 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -689,9 +689,11 @@ should do something like the following:
q = ACCESS_ONCE(a);
BUILD_BUG_ON(MAX <= 1); /* Order load from a with store to b. */
if (q % MAX) {
+ barrier();
ACCESS_ONCE(b) = p;
do_something();
} else {
+ barrier();
ACCESS_ONCE(b) = p;
do_something_else();
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists