X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Documentation%2Fspinlocks.txt;h=471e75389778eb0583be31eed6cce9d6babf67fa;hb=017f021c7e5fe3f82ccc5cbb7b1750e66e00f527;hp=a661d684768e99c2cb9737b1e5f85925554f9235;hpb=7e7d136e9e083f04b859411248c699cbb89e418d;p=firefly-linux-kernel-4.4.55.git 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 @@ -UPDATE March 21 2005 Amit Gud +SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED defeat lockdep state tracking and +are hence deprecated. -Macros SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated and will be -removed soon. So for any new code dynamic initialization should be used: +Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or +__SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate for static +initialization. + +Dynamic initialization, when necessary, may be performed as +demonstrated below. spinlock_t xxx_lock; rwlock_t xxx_rw_lock; @@ -15,12 +20,9 @@ removed soon. So for any new code dynamic initialization should be used: module_init(xxx_init); -Reasons for deprecation - - it hurts automatic lock validators - - it becomes intrusive for the realtime preemption patches - -Following discussion is still valid, however, with the dynamic initialization -of spinlocks instead of static. +The following discussion is still valid, however, with the dynamic +initialization of spinlocks or with DEFINE_SPINLOCK, etc., used +instead of SPIN_LOCK_UNLOCKED. -----------------------