Linux 5.10 Begins Landing The Long Overdue Revamp Of printk()

Written by Michael Larabel in Linux Kernel on 14 October 2020 at 11:58 AM EDT. 17 Comments
LINUX KERNEL
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.

Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week