
Among the flurry of last minute patch activity ahead of tomorrow's presumed Linux 7.3 stable kernel release is a fix for addressing some rare hangs at boot time. The reports varied but ultimately tracked down to a kernel change made two years ago.
Various bug reports have come about for common place SMP systems hanging on boot and was ultimately narrowed down to the non-blocking console "NBCON" code. To avoid these boot hangs, moving the start of the NBCON console printing KThreads to later in the boot process avoids these possible system hangs.
Linutronix engineer John Ogness explained in the now-merged fix of postponing the KThread start-up:
"There have been various bug reports related to SMP systems hanging on boot. The reports vary but seem to have some overlap with regard to missed IPI's during SMP setup. The reports also show that reverting NBCON console usage allows the bugs to disappear.The NBCON kthreads for console printing are started very early during boot using early_initcall(). Since these kthreads are asynchronously enabling/disabling interrupts during early boot, they may be interfering with early SMP setup on some hardware platforms.
Starting the console printing kthreads later has shown to avoid the hanging on systems that could previously reproduce the issue.
Postpone kthread starting until after all arch initcalls have completed."
This is treated as a fix for Linux kernel code present since September 2024 when printer KThreads were first introduced in the printk() code. Thus will presumably be back-ported in the days ahead from Linux 7.3 to other currently supported kernel branches.