Skip to content

Commit 66040b2

Browse files
Sebastian Andrzej SiewiorPeter Zijlstra
authored andcommitted
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: b2a02fc ("smp: Optimize send_call_function_single_ipi()") Reported-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20210123201027.3262800-2-bigeasy@linutronix.de
1 parent 92bf226 commit 66040b2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kernel/smp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/export.h>
1515
#include <linux/percpu.h>
1616
#include <linux/init.h>
17+
#include <linux/interrupt.h>
1718
#include <linux/gfp.h>
1819
#include <linux/smp.h>
1920
#include <linux/cpu.h>
@@ -449,6 +450,9 @@ void flush_smp_call_function_from_idle(void)
449450

450451
local_irq_save(flags);
451452
flush_smp_call_function_queue(true);
453+
if (local_softirq_pending())
454+
do_softirq();
455+
452456
local_irq_restore(flags);
453457
}
454458

0 commit comments

Comments
 (0)