From: Paul E. McKenney Date: Tue, 11 Feb 2014 20:28:06 +0000 (-0800) Subject: Documentation/memory-barriers.txt: Conditional must use prior load X-Git-Tag: next-20140306~34^2~19^2^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=586dd56a4c17611e3927c9ff02ab8d0a6a545b38;p=karo-tx-linux.git Documentation/memory-barriers.txt: Conditional must use prior load A control dependency consists of a load, a conditional that depends on that load, and a store. This commit emphasizes this point in the summary. Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett --- diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index f9ff060d8320..6b25efd45583 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt @@ -724,7 +724,8 @@ In summary: later loads, smp_mb(). (*) Control dependencies require at least one run-time conditional - between the prior load and the subsequent store. If the compiler + between the prior load and the subsequent store, and this + conditional must involve the prior load. If the compiler is able to optimize the conditional away, it will have also optimized away the ordering. Careful use of ACCESS_ONCE() can help to preserve the needed conditional.