From 2cd745fc0bec9bad3bd8a6fc14e34c3497d2b0c9 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 20 Jun 2024 11:21:13 +0200 Subject: [PATCH] prinkt/nbcon: Add a scheduling point to nbcon_kthread_func(). Constant printing can lead to a CPU hog in nbcon_kthread_func(). The context is preemptible but on !PREEMPT kernels there is no explicit preemption point which leads softlockup warnings. Add an explicit preemption point in nbcon_kthread_func(). Reported-by: Derek Barbosa Link: https://lore.kernel.org/ZnHF5j1DUDjN1kkq@debarbos-thinkpadt14sgen2i.remote.csb Reviewed-by: John Ogness Acked-by: Andrew Halaney Tested-by: Andrew Halaney Acked-by: Derek Barbosa Tested-by: Derek Barbosa Link: https://lore.kernel.org/r/20240620094300.YJlW043f@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Clark Williams --- kernel/printk/nbcon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c index b53d93585ee7..b941039ee7d2 100644 --- a/kernel/printk/nbcon.c +++ b/kernel/printk/nbcon.c @@ -1081,6 +1081,7 @@ wait_for_event: } console_srcu_read_unlock(cookie); + cond_resched(); } while (backlog);