From: Sebastian Andrzej Siewior Date: Sat, 23 Jan 2021 20:10:25 +0000 (+0100) Subject: smp: Process pending softirqs in flush_smp_call_function_from_idle() X-Git-Tag: accepted/tizen/unified/20230118.172025~7848^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9d34595ae4feed38856b88769e2ba5af22d2548;p=platform%2Fkernel%2Flinux-rpi.git smp: Process pending softirqs in flush_smp_call_function_from_idle() send_call_function_single_ipi() may wake an idle CPU without sending an IPI. The woken up CPU will process the SMP-functions in flush_smp_call_function_from_idle(). Any raised softirq from within the SMP-function call will not be processed. Should the CPU have no tasks assigned, then it will go back to idle with pending softirqs and the NOHZ will rightfully complain. Process pending softirqs on return from flush_smp_call_function_queue(). Fixes: b2a02fc43a1f4 ("smp: Optimize send_call_function_single_ipi()") Reported-by: Jens Axboe Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lkml.kernel.org/r/20210123201027.3262800-2-bigeasy@linutronix.de --- diff --git a/kernel/smp.c b/kernel/smp.c index 1b6070b..aeb0adfa 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -449,6 +450,9 @@ void flush_smp_call_function_from_idle(void) local_irq_save(flags); flush_smp_call_function_queue(true); + if (local_softirq_pending()) + do_softirq(); + local_irq_restore(flags); }