summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/perf-core-Add-SRCU-annotation-for-pmus-list-walk.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/perf-core-Add-SRCU-annotation-for-pmus-list-walk.patch')
-rw-r--r--debian/patches-rt/perf-core-Add-SRCU-annotation-for-pmus-list-walk.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/patches-rt/perf-core-Add-SRCU-annotation-for-pmus-list-walk.patch b/debian/patches-rt/perf-core-Add-SRCU-annotation-for-pmus-list-walk.patch
new file mode 100644
index 000000000..3e038d436
--- /dev/null
+++ b/debian/patches-rt/perf-core-Add-SRCU-annotation-for-pmus-list-walk.patch
@@ -0,0 +1,31 @@
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Fri, 15 Nov 2019 18:04:07 +0100
+Subject: [PATCH] perf/core: Add SRCU annotation for pmus list walk
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.4/older/patches-5.4.3-rt1.tar.xz
+
+Since commit
+ 28875945ba98d ("rcu: Add support for consolidated-RCU reader checking")
+
+there is an additional check to ensure that a RCU related lock is held
+while the RCU list is iterated.
+This section holds the SRCU reader lock instead.
+
+Add annotation to list_for_each_entry_rcu() that pmus_srcu must be
+acquired during the list traversal.
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ kernel/events/core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/events/core.c
++++ b/kernel/events/core.c
+@@ -10258,7 +10258,7 @@ static struct pmu *perf_init_event(struc
+ goto unlock;
+ }
+
+- list_for_each_entry_rcu(pmu, &pmus, entry) {
++ list_for_each_entry_rcu(pmu, &pmus, entry, lockdep_is_held(&pmus_srcu)) {
+ ret = perf_try_init_event(pmu, event);
+ if (!ret)
+ goto unlock;