14 #include <linux/export.h>
19 #ifdef CONFIG_DEBUG_LOCK_ALLOC
37 #ifdef CONFIG_DEBUG_LOCK_ALLOC
64 owner ? owner->
comm :
"<none>",
65 owner ? task_pid_nr(owner) : -1,
78 #define SPIN_BUG_ON(cond, lock, msg) if (unlikely(cond)) spin_bug(lock, msg)
86 lock,
"cpu recursion");
103 lock->owner_cpu = -1;
111 for (i = 0; i < loops; i++) {
117 spin_dump(lock,
"lockup suspected");
119 trigger_all_cpu_backtrace();
135 debug_spin_lock_before(lock);
137 __spin_lock_debug(lock);
138 debug_spin_lock_after(lock);
146 debug_spin_lock_after(lock);
158 debug_spin_unlock(lock);
162 static void rwlock_bug(
rwlock_t *lock,
const char *msg)
173 #define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg)
176 static void __read_lock_debug(
rwlock_t *lock)
183 for (i = 0; i < loops; i++) {
226 static inline void debug_write_lock_before(
rwlock_t *lock)
231 lock,
"cpu recursion");
234 static inline void debug_write_lock_after(
rwlock_t *lock)
240 static inline void debug_write_unlock(
rwlock_t *lock)
247 lock->owner_cpu = -1;
251 static void __write_lock_debug(
rwlock_t *lock)
258 for (i = 0; i < loops; i++) {
278 debug_write_lock_before(lock);
280 debug_write_lock_after(lock);
288 debug_write_lock_after(lock);
300 debug_write_unlock(lock);