Skip to content

Commit d372e20

Browse files
committed
Documentation/atomic_t: Emphasize that failed atomic operations give no ordering
The ORDERING section of Documentation/atomic_t.txt can easily be read as saying that conditional atomic RMW operations that fail are ordered when those operations have the _acquire() or _release() suffixes. This is not the case, therefore update this section to make it clear that failed conditional atomic RMW operations provide no ordering. Reported-by: Anna-Maria Behnsen <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Cc: Alan Stern <[email protected]> Cc: Will Deacon <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Boqun Feng <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: David Howells <[email protected]> Cc: Jade Alglave <[email protected]> Cc: Luc Maranget <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Cc: Akira Yokosawa <[email protected]> Cc: Daniel Lustig <[email protected]> Cc: Joel Fernandes <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Acked-by: Andrea Parri <[email protected]> Acked-by: Mark Rutland <[email protected]>
1 parent 293f5bc commit d372e20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Documentation/atomic_t.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,14 @@ The rule of thumb:
171171
- RMW operations that are conditional are unordered on FAILURE,
172172
otherwise the above rules apply.
173173

174-
Except of course when an operation has an explicit ordering like:
174+
Except of course when a successful operation has an explicit ordering like:
175175

176176
{}_relaxed: unordered
177177
{}_acquire: the R of the RMW (or atomic_read) is an ACQUIRE
178178
{}_release: the W of the RMW (or atomic_set) is a RELEASE
179179

180180
Where 'unordered' is against other memory locations. Address dependencies are
181-
not defeated.
181+
not defeated. Conditional operations are still unordered on FAILURE.
182182

183183
Fully ordered primitives are ordered against everything prior and everything
184184
subsequent. Therefore a fully ordered primitive is like having an smp_mb()

0 commit comments

Comments
 (0)