summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0003-tracing-Use-in_serving_softirq-to-deduct-softirq-sta.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/0003-tracing-Use-in_serving_softirq-to-deduct-softirq-sta.patch')
-rw-r--r--debian/patches-rt/0003-tracing-Use-in_serving_softirq-to-deduct-softirq-sta.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/debian/patches-rt/0003-tracing-Use-in_serving_softirq-to-deduct-softirq-sta.patch b/debian/patches-rt/0003-tracing-Use-in_serving_softirq-to-deduct-softirq-sta.patch
new file mode 100644
index 000000000..334c9bb82
--- /dev/null
+++ b/debian/patches-rt/0003-tracing-Use-in_serving_softirq-to-deduct-softirq-sta.patch
@@ -0,0 +1,42 @@
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Wed, 3 Feb 2021 11:05:25 -0500
+Subject: [PATCH 3/4] tracing: Use in_serving_softirq() to deduct softirq
+ status.
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.21-rt34.tar.xz
+
+PREEMPT_RT does not report "serving softirq" because the tracing core
+looks at the preemption counter while PREEMPT_RT does not update it
+while processing softirqs in order to remain preemptible. The
+information is stored somewhere else.
+The in_serving_softirq() macro and the SOFTIRQ_OFFSET define are still
+working but not on the preempt-counter.
+
+Use in_serving_softirq() macro which works on PREEMPT_RT. On !PREEMPT_RT
+the compiler (gcc-10 / clang-11) is smart enough to optimize the
+in_serving_softirq() related read of the preemption counter away.
+The only difference I noticed by using in_serving_softirq() on
+!PREEMPT_RT is that gcc-10 implemented tracing_gen_ctx_flags() as
+reading FLAG, jmp _tracing_gen_ctx_flags(). Without in_serving_softirq()
+it inlined _tracing_gen_ctx_flags() into tracing_gen_ctx_flags().
+
+Link: https://lkml.kernel.org/r/20210125194511.3924915-4-bigeasy@linutronix.de
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ kernel/trace/trace.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/kernel/trace/trace.c
++++ b/kernel/trace/trace.c
+@@ -2589,8 +2589,7 @@ unsigned int tracing_gen_ctx_irq_test(un
+ trace_flags |= TRACE_FLAG_NMI;
+ if (pc & HARDIRQ_MASK)
+ trace_flags |= TRACE_FLAG_HARDIRQ;
+-
+- if (pc & SOFTIRQ_OFFSET)
++ if (in_serving_softirq())
+ trace_flags |= TRACE_FLAG_SOFTIRQ;
+
+ if (tif_need_resched())