linux/debian/patches-rt/0118-lockdep-Make-it-RT-awa...

75 lines
2.2 KiB
Diff
Raw Normal View History

From: Thomas Gleixner <tglx@linutronix.de>
Date: Sun, 17 Jul 2011 18:51:23 +0200
2019-11-25 00:04:39 +00:00
Subject: [PATCH 118/290] lockdep: Make it RT aware
Origin: https://git.kernel.org/cgit/linux/kernel/git/rt/linux-stable-rt.git/commit?id=7effdc8f2c197c37436e86a7b4ab376cf38b498f
teach lockdep that we don't really do softirqs on -RT.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
2019-04-08 23:49:20 +00:00
include/linux/irqflags.h | 23 +++++++++++++++--------
kernel/locking/lockdep.c | 2 ++
2 files changed, 17 insertions(+), 8 deletions(-)
2019-04-08 23:49:20 +00:00
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
index 21619c92c377..b20eeb25e9fa 100644
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
2018-10-30 12:40:05 +00:00
@@ -43,14 +43,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)
2019-04-08 23:49:20 +00:00
@@ -64,6 +56,21 @@ do { \
# define lockdep_softirq_exit() do { } while (0)
#endif
2019-04-08 23:49:20 +00:00
+#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
2019-04-08 23:49:20 +00:00
+
#if defined(CONFIG_IRQSOFF_TRACER) || \
defined(CONFIG_PREEMPT_TRACER)
2019-04-08 23:49:20 +00:00
extern void stop_critical_timings(void);
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
2019-11-25 00:04:39 +00:00
index 1e272f6a01e7..1938b4bfb098 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
2019-11-25 00:04:39 +00:00
@@ -3826,6 +3826,7 @@ static void check_flags(unsigned long flags)
}
}
+#ifndef CONFIG_PREEMPT_RT_FULL
/*
* We dont accurately track softirq state in e.g.
* hardirq contexts (such as on 4KSTACKS), so only
2019-11-25 00:04:39 +00:00
@@ -3840,6 +3841,7 @@ static void check_flags(unsigned long flags)
DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled);
}
}
+#endif
if (!debug_locks)
print_irqtrace_events(current);