Re: [syzbot] possible deadlock in wake_up_all_idle_cpus

From: Sebastian Andrzej Siewior
Date: Tue Oct 19 2021 - 15:08:17 EST


Does this do anything useful?

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
kernel/smp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/smp.c b/kernel/smp.c
index ad0b68a3a3d36..b3bf528fa14d3 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -1170,14 +1170,14 @@ void wake_up_all_idle_cpus(void)
{
int cpu;

- cpus_read_lock();
+ migrate_disable();
for_each_online_cpu(cpu) {
if (cpu == raw_smp_processor_id())
continue;

wake_up_if_idle(cpu);
}
- cpus_read_unlock();
+ migrate_enable();
}
EXPORT_SYMBOL_GPL(wake_up_all_idle_cpus);

--
2.33.0