Home Home > GIT Browse
diff options
authorRusty Russell <rusty@rustcorp.com.au>2002-03-07 00:44:45 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-03-07 00:44:45 -0800
commit2f41abeb481334d7e3cfedb72645ad0002747f78 (patch)
parent8528eb38020082d6c9a32b7ea39a275c85279bc3 (diff)
[PATCH] 2.5.6-pre3. Documentation
atomic ops are *not* barriers any more. Sebastian Wilhelmi <wilhelmi@ira.uka.de>: Re: Question on your "Unreliable Guide To Locking": > Yes, this is no longer true. The modern assumptions are that they are > not barriers.
1 files changed, 12 insertions, 2 deletions
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl
index 3acdf3bc7377..bd1582a3412a 100644
--- a/Documentation/DocBook/kernel-locking.tmpl
+++ b/Documentation/DocBook/kernel-locking.tmpl
@@ -788,8 +788,18 @@
- Note that the atomic operations are defined to act as both
- read and write barriers on all platforms.
+ Note that the atomic operations do in general not act as memory
+ barriers. Instead you can insert a memory barrier before or
+ after <function>atomic_inc()</function> or
+ <function>atomic_dec()</function> by inserting
+ <function>smp_mb__before_atomic_inc()</function>,
+ <function>smp_mb__after_atomic_inc()</function>,
+ <function>smp_mb__before_atomic_dec()</function> or
+ <function>smp_mb__after_atomic_dec()</function>
+ respectively. The advantage of using those macros instead of
+ <function>smp_mb()</function> is, that they are cheaper on some
+ platforms.
+ <!-- Sebastian Wilhelmi <seppi@seppi.de> 2002-03-04 -->