5 While our bitmap_{}() functions are non-atomic, we have a number of operations
6 operating on single bits in a bitmap that are atomic.
12 The single bit operations are:
18 RMW atomic operations without return value:
20 {set,clear,change}_bit()
23 RMW atomic operations with return value:
25 test_and_{set,clear,change}_bit()
26 test_and_set_bit_lock()
30 smp_mb__{before,after}_atomic()
33 All RMW atomic operations have a '__' prefixed variant which is non-atomic.
41 In particular __clear_bit_unlock() suffers the same issue as atomic_set(),
42 which is why the generic version maps to clear_bit_unlock(), see atomic_t.txt.
47 The test_and_{}_bit() operations return the original value of the bit.
53 Like with atomic_t, the rule of thumb is:
55 - non-RMW operations are unordered;
57 - RMW operations that have no return value are unordered;
59 - RMW operations that have a return value are fully ordered.
61 - RMW operations that are conditional are unordered on FAILURE,
62 otherwise the above rules apply. In the case of test_and_set_bit_lock(),
63 if the bit in memory is unchanged by the operation then it is deemed to have
66 Except for a successful test_and_set_bit_lock() which has ACQUIRE semantics and
67 clear_bit_unlock() which has RELEASE semantics.
69 Since a platform only has a single means of achieving atomic operations
70 the same barriers as for atomic_t are used, see atomic_t.txt.