VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   30 Branches   50 Tags
author: Sebastian Andrzej Siewior <bigeasy@linutronix.de> 2021-09-27 09:38:14 +0200 committer: Minda Chen <minda.chen@starfivetech.com> 2023-11-06 19:24:41 +0800 commit: 4a5ffdec1aa9d11d4eac1b45ff0ecd83ca8bcb64 parent: b3d89e9d915153d6e7a2d56a61217292663be4bb
Commit Summary:
smp: Wake ksoftirqd on PREEMPT_RT instead do_softirq().
Diffstat:
1 file changed, 10 insertions, 2 deletions
diff --git a/kernel/smp.c b/kernel/smp.c
index f43ede0ab183..f0f26e1a0031 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -690,10 +690,20 @@ void flush_smp_call_function_from_idle(void)
 
 	cfd_seq_store(this_cpu_ptr(&cfd_seq_local)->idle, CFD_SEQ_NOCPU,
 		      smp_processor_id(), CFD_SEQ_IDLE);
+
 	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 && !task_is_running(ksoftirqd))
+				wake_up_process(ksoftirqd);
+		}
+	}
 
 	local_irq_restore(flags);
 }