Linux Gets Patches For Threaded Console Printing
There has been a multi-year effort to overhaul the Linux kernel's printk() code and as part of that the newest patch series out is providing threaded console printing support.
This threaded console printing support is fulfilling plans drafted back in 2019 to create a kernel thread for each registered console and making console printing completely decoupled from printk() callers.
John Ogness who has been heavily involved in the printk() rework explained of this threaded console printing code:
Ogness went on to add, "There are situations where kthread printing is not sufficient. For example, during early boot before kthreads exist or during panic situations, where the kthreads may not get a chance to schedule. In these cases, the current method of printing directly within the printk() caller context is used."
This threaded console printing support in its initial form is reworking less than one thousand lines of the printk code. Those interested in learning more of the finer details can see the patch series.
This threaded console printing support is fulfilling plans drafted back in 2019 to create a kernel thread for each registered console and making console printing completely decoupled from printk() callers.
John Ogness who has been heavily involved in the printk() rework explained of this threaded console printing code:
This series implements a kthread for each registered console. The kthreads locklessly retrieve the records from the printk ringbuffer and also do not cause any lock contention between one another. This allows consoles to run at full speed. For example, a netconsole is able to dump records much faster than a serial or vt console.
Ogness went on to add, "There are situations where kthread printing is not sufficient. For example, during early boot before kthreads exist or during panic situations, where the kthreads may not get a chance to schedule. In these cases, the current method of printing directly within the printk() caller context is used."
This threaded console printing support in its initial form is reworking less than one thousand lines of the printk code. Those interested in learning more of the finer details can see the patch series.
12 Comments