@@ -285,15 +285,13 @@ If a caller requires memory barrier semantics around an atomic_t
285285operation which does not return a value, a set of interfaces are
286286defined which accomplish this:
287287
288- void smp_mb__before_atomic_dec(void);
289- void smp_mb__after_atomic_dec(void);
290- void smp_mb__before_atomic_inc(void);
291- void smp_mb__after_atomic_inc(void);
288+ void smp_mb__before_atomic(void);
289+ void smp_mb__after_atomic(void);
292290
293- For example, smp_mb__before_atomic_dec () can be used like so:
291+ For example, smp_mb__before_atomic () can be used like so:
294292
295293 obj->dead = 1;
296- smp_mb__before_atomic_dec ();
294+ smp_mb__before_atomic ();
297295 atomic_dec(&obj->ref_count);
298296
299297It makes sure that all memory operations preceding the atomic_dec()
@@ -302,15 +300,10 @@ operation. In the above example, it guarantees that the assignment of
302300"1" to obj->dead will be globally visible to other cpus before the
303301atomic counter decrement.
304302
305- Without the explicit smp_mb__before_atomic_dec () call, the
303+ Without the explicit smp_mb__before_atomic () call, the
306304implementation could legally allow the atomic counter update visible
307305to other cpus before the "obj->dead = 1;" assignment.
308306
309- The other three interfaces listed are used to provide explicit
310- ordering with respect to memory operations after an atomic_dec() call
311- (smp_mb__after_atomic_dec()) and around atomic_inc() calls
312- (smp_mb__{before,after}_atomic_inc()).
313-
314307A missing memory barrier in the cases where they are required by the
315308atomic_t implementation above can have disastrous results. Here is
316309an example, which follows a pattern occurring frequently in the Linux
@@ -487,26 +480,26 @@ Finally there is the basic operation:
487480Which returns a boolean indicating if bit "nr" is set in the bitmask
488481pointed to by "addr".
489482
490- If explicit memory barriers are required around clear_bit () (which
491- does not return a value, and thus does not need to provide memory
492- barrier semantics), two interfaces are provided:
483+ If explicit memory barriers are required around {set,clear}_bit () (which do
484+ not return a value, and thus does not need to provide memory barrier
485+ semantics), two interfaces are provided:
493486
494- void smp_mb__before_clear_bit (void);
495- void smp_mb__after_clear_bit (void);
487+ void smp_mb__before_atomic (void);
488+ void smp_mb__after_atomic (void);
496489
497490They are used as follows, and are akin to their atomic_t operation
498491brothers:
499492
500493 /* All memory operations before this call will
501494 * be globally visible before the clear_bit().
502495 */
503- smp_mb__before_clear_bit ();
496+ smp_mb__before_atomic ();
504497 clear_bit( ... );
505498
506499 /* The clear_bit() will be visible before all
507500 * subsequent memory operations.
508501 */
509- smp_mb__after_clear_bit ();
502+ smp_mb__after_atomic ();
510503
511504There are two special bitops with lock barrier semantics (acquire/release,
512505same as spinlocks). These operate in the same way as their non-_lock/unlock
0 commit comments