diff options
Diffstat (limited to 'Documentation/spinlocks.txt')
-rw-r--r-- | Documentation/spinlocks.txt | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Documentation/spinlocks.txt b/Documentation/spinlocks.txt index a661d684768e..471e75389778 100644 --- a/Documentation/spinlocks.txt +++ b/Documentation/spinlocks.txt | |||
@@ -1,7 +1,12 @@ | |||
1 | UPDATE March 21 2005 Amit Gud <gud@eth.net> | 1 | SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED defeat lockdep state tracking and |
2 | are hence deprecated. | ||
2 | 3 | ||
3 | Macros SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated and will be | 4 | Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or |
4 | removed soon. So for any new code dynamic initialization should be used: | 5 | __SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate for static |
6 | initialization. | ||
7 | |||
8 | Dynamic initialization, when necessary, may be performed as | ||
9 | demonstrated below. | ||
5 | 10 | ||
6 | spinlock_t xxx_lock; | 11 | spinlock_t xxx_lock; |
7 | rwlock_t xxx_rw_lock; | 12 | rwlock_t xxx_rw_lock; |
@@ -15,12 +20,9 @@ removed soon. So for any new code dynamic initialization should be used: | |||
15 | 20 | ||
16 | module_init(xxx_init); | 21 | module_init(xxx_init); |
17 | 22 | ||
18 | Reasons for deprecation | 23 | The following discussion is still valid, however, with the dynamic |
19 | - it hurts automatic lock validators | 24 | initialization of spinlocks or with DEFINE_SPINLOCK, etc., used |
20 | - it becomes intrusive for the realtime preemption patches | 25 | instead of SPIN_LOCK_UNLOCKED. |
21 | |||
22 | Following discussion is still valid, however, with the dynamic initialization | ||
23 | of spinlocks instead of static. | ||
24 | 26 | ||
25 | ----------------------- | 27 | ----------------------- |
26 | 28 | ||