Linux 5.10 Begins Landing The Long Overdue Revamp Of printk()
The Linux kernel's fundamental printk() function for printing messages at various log levels for then accessing via the likes of dmesg is beginning to see a significant overhaul.
Coming with Linux 5.10 is now a fully lock-less ring-buffer implementation for printk. This new implementation allows for storing and reading messages without the possibility of deadlocks or relying on temporary per-CPU buffers.
This fully lock-less ring-buffer though is still relying on a log buffer lock but the hope is that for Linux 5.11 that lock can be removed.
Besides still having a lock to remove, the printk rework is also working towards making use of KThreads as a next step.
The lockless ringbuffer implementation was sent in (and already merged) via this pull request.
For many more details on the existing challenges with Linux's printk and the rework that's long been in progress, there is this slide deck (PDF) from Linux Plumbers Conference 2019 by John Ogness outlining printk's history and the ongoing work to improve it. Below is also the LPC2019 video recording of that talk.
Coming with Linux 5.10 is now a fully lock-less ring-buffer implementation for printk. This new implementation allows for storing and reading messages without the possibility of deadlocks or relying on temporary per-CPU buffers.
This fully lock-less ring-buffer though is still relying on a log buffer lock but the hope is that for Linux 5.11 that lock can be removed.
Besides still having a lock to remove, the printk rework is also working towards making use of KThreads as a next step.
The lockless ringbuffer implementation was sent in (and already merged) via this pull request.
For many more details on the existing challenges with Linux's printk and the rework that's long been in progress, there is this slide deck (PDF) from Linux Plumbers Conference 2019 by John Ogness outlining printk's history and the ongoing work to improve it. Below is also the LPC2019 video recording of that talk.
17 Comments