Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2017-11-15 14:39:17 +0000
committerMel Gorman <mgorman@suse.de>2017-11-15 14:39:19 +0000
commit954b35bae70467a2144a0c83e7c6dd0e8c1abe9e (patch)
tree5c57a13873e7a1bd34534c05172a5de4e087d639
parent9d790c39b9c09670ca09a4354afb5db3c5075ba6 (diff)
locking/lockdep: Add IRQs disabled/enabled assertion APIs:
lockdep_assert_irqs_enabled()/disabled() (bnc#1068202 Avoid irqs_disabled debugging checks in fast paths). suse-commit: 26a57873714a9140a1d6fdb40f850758304e749a
-rw-r--r--include/linux/lockdep.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index fffe49f188e6..0125a04ed343 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -586,9 +586,24 @@ do { \
lock_acquire(&(lock)->dep_map, 0, 0, 1, 1, NULL, _THIS_IP_); \
lock_release(&(lock)->dep_map, 0, _THIS_IP_); \
} while (0)
+
+#define lockdep_assert_irqs_enabled() do { \
+ WARN_ONCE(debug_locks && !current->lockdep_recursion && \
+ !current->hardirqs_enabled, \
+ "IRQs not enabled as expected\n"); \
+ } while (0)
+
+#define lockdep_assert_irqs_disabled() do { \
+ WARN_ONCE(debug_locks && !current->lockdep_recursion && \
+ current->hardirqs_enabled, \
+ "IRQs not disabled as expected\n"); \
+ } while (0)
+
#else
# define might_lock(lock) do { } while (0)
# define might_lock_read(lock) do { } while (0)
+# define lockdep_assert_irqs_enabled() do { } while (0)
+# define lockdep_assert_irqs_disabled() do { } while (0)
#endif
#ifdef CONFIG_LOCKDEP