2018-08-27 14:32:32 +00:00
|
|
|
Subject: lockdep: Make it RT aware
|
|
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
Date: Sun, 17 Jul 2011 18:51:23 +0200
|
2018-09-13 17:28:08 +00:00
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.18/older/patches-4.18.7-rt5.tar.xz
|
2018-08-27 14:32:32 +00:00
|
|
|
|
|
|
|
teach lockdep that we don't really do softirqs on -RT.
|
|
|
|
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
---
|
|
|
|
include/linux/irqflags.h | 23 +++++++++++++++--------
|
|
|
|
kernel/locking/lockdep.c | 2 ++
|
|
|
|
2 files changed, 17 insertions(+), 8 deletions(-)
|
|
|
|
|
|
|
|
--- a/include/linux/irqflags.h
|
|
|
|
+++ b/include/linux/irqflags.h
|
|
|
|
@@ -32,14 +32,6 @@ do { \
|
|
|
|
do { \
|
|
|
|
current->hardirq_context--; \
|
|
|
|
} while (0)
|
|
|
|
-# define lockdep_softirq_enter() \
|
|
|
|
-do { \
|
|
|
|
- current->softirq_context++; \
|
|
|
|
-} while (0)
|
|
|
|
-# define lockdep_softirq_exit() \
|
|
|
|
-do { \
|
|
|
|
- current->softirq_context--; \
|
|
|
|
-} while (0)
|
|
|
|
#else
|
|
|
|
# define trace_hardirqs_on() do { } while (0)
|
|
|
|
# define trace_hardirqs_off() do { } while (0)
|
|
|
|
@@ -54,6 +46,21 @@ do { \
|
|
|
|
# define lockdep_softirq_enter() do { } while (0)
|
|
|
|
# define lockdep_softirq_exit() do { } while (0)
|
|
|
|
#endif
|
|
|
|
+
|
|
|
|
+#if defined(CONFIG_TRACE_IRQFLAGS) && !defined(CONFIG_PREEMPT_RT_FULL)
|
|
|
|
+# define lockdep_softirq_enter() \
|
|
|
|
+do { \
|
|
|
|
+ current->softirq_context++; \
|
|
|
|
+} while (0)
|
|
|
|
+# define lockdep_softirq_exit() \
|
|
|
|
+do { \
|
|
|
|
+ current->softirq_context--; \
|
|
|
|
+} while (0)
|
|
|
|
+
|
|
|
|
+#else
|
|
|
|
+# define lockdep_softirq_enter() do { } while (0)
|
|
|
|
+# define lockdep_softirq_exit() do { } while (0)
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
#if defined(CONFIG_IRQSOFF_TRACER) || \
|
|
|
|
defined(CONFIG_PREEMPT_TRACER)
|
|
|
|
--- a/kernel/locking/lockdep.c
|
|
|
|
+++ b/kernel/locking/lockdep.c
|
|
|
|
@@ -3847,6 +3847,7 @@ static void check_flags(unsigned long fl
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
/*
|
|
|
|
* We dont accurately track softirq state in e.g.
|
|
|
|
* hardirq contexts (such as on 4KSTACKS), so only
|
|
|
|
@@ -3861,6 +3862,7 @@ static void check_flags(unsigned long fl
|
|
|
|
DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (!debug_locks)
|
|
|
|
print_irqtrace_events(current);
|