2020-04-21 20:13:52 +00:00
|
|
|
From 8ed2b42d1e41402d585e7907ef754461cda3ff25 Mon Sep 17 00:00:00 2001
|
2018-08-27 14:32:32 +00:00
|
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
Date: Sun, 17 Jul 2011 18:51:23 +0200
|
2020-04-21 20:13:52 +00:00
|
|
|
Subject: [PATCH 117/325] lockdep: Make it RT aware
|
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.115-rt48.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>
|
|
|
|
---
|
2019-04-08 23:49:20 +00:00
|
|
|
include/linux/irqflags.h | 23 +++++++++++++++--------
|
|
|
|
kernel/locking/lockdep.c | 2 ++
|
2018-08-27 14:32:32 +00:00
|
|
|
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
|
2018-08-27 14:32:32 +00:00
|
|
|
--- a/include/linux/irqflags.h
|
|
|
|
+++ b/include/linux/irqflags.h
|
2018-10-30 12:40:05 +00:00
|
|
|
@@ -43,14 +43,6 @@ do { \
|
2018-08-27 14:32:32 +00:00
|
|
|
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 { \
|
2018-08-27 14:32:32 +00:00
|
|
|
# define lockdep_softirq_exit() do { } while (0)
|
|
|
|
#endif
|
2019-04-08 23:49:20 +00:00
|
|
|
|
2018-08-27 14:32:32 +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
|
|
|
+
|
2018-08-27 14:32:32 +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
|
2018-08-27 14:32:32 +00:00
|
|
|
--- 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)
|
2018-08-27 14:32:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+#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)
|
2018-08-27 14:32:32 +00:00
|
|
|
DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (!debug_locks)
|
|
|
|
print_irqtrace_events(current);
|
2020-01-03 23:36:11 +00:00
|
|
|
--
|
2020-04-09 19:44:24 +00:00
|
|
|
2.25.1
|
2020-01-03 23:36:11 +00:00
|
|
|
|