hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/include/linux/debug_locks.h
....@@ -2,17 +2,18 @@
22 #ifndef __LINUX_DEBUG_LOCKING_H
33 #define __LINUX_DEBUG_LOCKING_H
44
5
-#include <linux/kernel.h>
65 #include <linux/atomic.h>
76 #include <linux/bug.h>
7
+#include <linux/printk.h>
8
+#include <linux/cache.h>
89
910 struct task_struct;
1011
11
-extern int debug_locks;
12
-extern int debug_locks_silent;
12
+extern int debug_locks __read_mostly;
13
+extern int debug_locks_silent __read_mostly;
1314
1415
15
-static inline int __debug_locks_off(void)
16
+static __always_inline int __debug_locks_off(void)
1617 {
1718 return xchg(&debug_locks, 0);
1819 }
....@@ -27,8 +28,10 @@
2728 int __ret = 0; \
2829 \
2930 if (!oops_in_progress && unlikely(c)) { \
31
+ instrumentation_begin(); \
3032 if (debug_locks_off() && !debug_locks_silent) \
3133 WARN(1, "DEBUG_LOCKS_WARN_ON(%s)", #c); \
34
+ instrumentation_end(); \
3235 __ret = 1; \
3336 } \
3437 __ret; \