summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0131-smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/0131-smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch')
-rw-r--r--debian/patches-rt/0131-smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/debian/patches-rt/0131-smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch b/debian/patches-rt/0131-smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch
new file mode 100644
index 000000000..19d4f6615
--- /dev/null
+++ b/debian/patches-rt/0131-smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch
@@ -0,0 +1,48 @@
+From d6a969bae816bcd5ac549038a4582d300ede6b99 Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Mon, 15 Feb 2021 18:44:12 +0100
+Subject: [PATCH 131/323] smp: Wake ksoftirqd on PREEMPT_RT instead
+ do_softirq().
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.204-rt100.tar.xz
+
+The softirq implementation on PREEMPT_RT does not provide do_softirq().
+The other user of do_softirq() is replaced with a local_bh_disable()
++ enable() around the possible raise-softirq invocation. This can not be
+done here because migration_cpu_stop() is invoked with disabled
+preemption.
+
+Wake the softirq thread on PREEMPT_RT if there are any pending softirqs.
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ kernel/smp.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/kernel/smp.c b/kernel/smp.c
+index b0684b4c111e..4aaf11aa729c 100644
+--- a/kernel/smp.c
++++ b/kernel/smp.c
+@@ -450,8 +450,18 @@ void flush_smp_call_function_from_idle(void)
+
+ local_irq_save(flags);
+ flush_smp_call_function_queue(true);
+- if (local_softirq_pending())
+- do_softirq();
++
++ if (local_softirq_pending()) {
++
++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) {
++ do_softirq();
++ } else {
++ struct task_struct *ksoftirqd = this_cpu_ksoftirqd();
++
++ if (ksoftirqd && ksoftirqd->state != TASK_RUNNING)
++ wake_up_process(ksoftirqd);
++ }
++ }
+
+ local_irq_restore(flags);
+ }
+--
+2.43.0
+