| /linux/rust/kernel/sync/ |
| H A D | atomic.rs | 20 pub mod ordering; module 24 pub use ordering::{Acquire, Full, Relaxed, Release}; 30 use ordering::OrderingType; 269 pub fn load<Ordering: ordering::AcquireOrRelaxed>(&self, _: Ordering) -> T { in load() 299 pub fn store<Ordering: ordering::ReleaseOrRelaxed>(&self, v: T, _: Ordering) { in store() 340 pub fn xchg<Ordering: ordering::Ordering>(&self, v: T, _: Ordering) -> T { in xchg() 411 pub fn cmpxchg<Ordering: ordering::Ordering>( in cmpxchg() 458 fn try_cmpxchg<Ordering: ordering::Ordering>(&self, old: &mut T, new: T, _: Ordering) -> bool { in try_cmpxchg() 508 pub fn add<Rhs>(&self, v: Rhs, _: ordering::Relaxed) in add() 542 pub fn fetch_add<Rhs, Ordering: ordering::Ordering>(&self, v: Rhs, _: Ordering) -> T in fetch_add()
|
| /linux/tools/memory-model/Documentation/ |
| H A D | ordering.txt | 1 This document gives an overview of the categories of memory-ordering 8 This section lists LKMM's three top-level categories of memory-ordering 20 3. Unordered accesses, as the name indicates, have no ordering 23 some of these "unordered" operations provide limited ordering 38 b. Read-modify-write (RMW) ordering augmentation barriers. 50 ordering primitives provided for that purpose. For example, instead of 58 The Linux-kernel primitives that provide full ordering include: 79 memory-ordering primitives. It is surprisingly hard to remember their 82 Second, some RMW atomic operations provide full ordering. These 87 as cmpxchg() are only guaranteed to provide ordering when they succeed. [all …]
|
| H A D | control-dependencies.txt | 12 Therefore, a load-load control dependency will not preserve ordering 19 This is not guaranteed to provide any ordering because some types of CPUs 31 However, stores are not speculated. This means that ordering is 40 of ordering. But please note that neither the READ_ONCE() nor the 59 It is tempting to try use control dependencies to enforce ordering on 78 WRITE_ONCE(b, 1); /* BUG: No ordering vs. load from a!!! */ 91 have been applied. Therefore, if you need ordering in this example, 92 you must use explicit memory ordering, for example, smp_store_release(): 103 Without explicit memory ordering, control-dependency-based ordering is 121 preserve ordering. For example: [all …]
|
| /linux/scripts/atomic/kerneldoc/ |
| H A D | dec_unless_positive | 3 * ${class}${atomicname}() - atomic decrement unless positive with ${desc_order} ordering 6 * If (@v <= 0), atomically updates @v to (@v - 1) with ${desc_order} ordering. 7 * Otherwise, @v is not modified and relaxed ordering is provided.
|
| H A D | inc_not_zero | 3 * ${class}${atomicname}() - atomic increment unless zero with ${desc_order} ordering 6 * If (@v != 0), atomically updates @v to (@v + 1) with ${desc_order} ordering. 7 * Otherwise, @v is not modified and relaxed ordering is provided.
|
| H A D | inc_unless_negative | 3 * ${class}${atomicname}() - atomic increment unless negative with ${desc_order} ordering 6 * If (@v >= 0), atomically updates @v to (@v + 1) with ${desc_order} ordering. 7 * Otherwise, @v is not modified and relaxed ordering is provided.
|
| H A D | dec_if_positive | 3 * ${class}${atomicname}() - atomic decrement if positive with ${desc_order} ordering 6 * If (@v > 0), atomically updates @v to (@v - 1) with ${desc_order} ordering. 7 * Otherwise, @v is not modified and relaxed ordering is provided.
|
| H A D | cmpxchg | 3 * ${class}${atomicname}() - atomic compare and exchange with ${desc_order} ordering 8 * If (@v == @old), atomically updates @v to @new with ${desc_order} ordering. 9 * Otherwise, @v is not modified and relaxed ordering is provided.
|
| H A D | add_unless | 7 * ${class}${atomicname}() - atomic add unless value with ${desc_order} ordering 12 * If (@v != @u), atomically updates @v to (@v + @a) with ${desc_order} ordering. 13 * Otherwise, @v is not modified and relaxed ordering is provided.
|
| H A D | try_cmpxchg | 3 * ${class}${atomicname}() - atomic compare and exchange with ${desc_order} ordering 8 * If (@v == @old), atomically updates @v to @new with ${desc_order} ordering. 10 * and relaxed ordering is provided.
|
| H A D | dec | 3 * ${class}${atomicname}() - atomic decrement with ${desc_order} ordering 6 * Atomically updates @v to (@v - 1) with ${desc_order} ordering.
|
| H A D | inc | 3 * ${class}${atomicname}() - atomic increment with ${desc_order} ordering 6 * Atomically updates @v to (@v + 1) with ${desc_order} ordering.
|
| H A D | and | 3 * ${class}${atomicname}() - atomic bitwise AND with ${desc_order} ordering 7 * Atomically updates @v to (@v & @i) with ${desc_order} ordering.
|
| H A D | xor | 3 * ${class}${atomicname}() - atomic bitwise XOR with ${desc_order} ordering 7 * Atomically updates @v to (@v ^ @i) with ${desc_order} ordering.
|
| H A D | or | 3 * ${class}${atomicname}() - atomic bitwise OR with ${desc_order} ordering 7 * Atomically updates @v to (@v | @i) with ${desc_order} ordering.
|
| H A D | sub | 3 * ${class}${atomicname}() - atomic subtract with ${desc_order} ordering 7 * Atomically updates @v to (@v - @i) with ${desc_order} ordering.
|
| H A D | andnot | 3 * ${class}${atomicname}() - atomic bitwise AND NOT with ${desc_order} ordering 7 * Atomically updates @v to (@v & ~@i) with ${desc_order} ordering.
|
| H A D | add | 3 * ${class}${atomicname}() - atomic add with ${desc_order} ordering 7 * Atomically updates @v to (@v + @i) with ${desc_order} ordering.
|
| H A D | set | 3 * ${class}${atomicname}() - atomic set with ${desc_order} ordering 7 * Atomically sets @v to @i with ${desc_order} ordering.
|
| H A D | read | 3 * ${class}${atomicname}() - atomic load with ${desc_order} ordering 6 * Atomically loads the value of @v with ${desc_order} ordering.
|
| H A D | xchg | 3 * ${class}${atomicname}() - atomic exchange with ${desc_order} ordering 7 * Atomically updates @v to @new with ${desc_order} ordering.
|
| H A D | inc_and_test | 3 * ${class}${atomicname}() - atomic increment and test if zero with ${desc_order} ordering 6 * Atomically updates @v to (@v + 1) with ${desc_order} ordering.
|
| H A D | dec_and_test | 3 * ${class}${atomicname}() - atomic decrement and test if zero with ${desc_order} ordering 6 * Atomically updates @v to (@v - 1) with ${desc_order} ordering.
|
| H A D | add_negative | 3 * ${class}${atomicname}() - atomic add and test if negative with ${desc_order} ordering 7 * Atomically updates @v to (@v + @i) with ${desc_order} ordering.
|
| H A D | sub_and_test | 3 * ${class}${atomicname}() - atomic subtract and test if zero with ${desc_order} ordering 7 * Atomically updates @v to (@v - @i) with ${desc_order} ordering.
|