Printk Changes Submitted For Linux 6.12 Finish NBCON Console Preparations
([Linux Kernel] 5 Hours Ago
Printk)
- Reference: 0001491551
- News link: https://www.phoronix.com/news/Linux-6.12-Printk-Pull-Request
- Source link:
Ahead of the Linux 6.12 kernel merge window opening on Monday, the printk updates were submitted in advance given the Linux Kernel Maintainer Summit also taking place next week in Vienna. Notable with the printk updates is finishing up the NBCON console work that is notable as [1]the last major blocker before real-time (PREEMPT_RT) support can be finally mainlined.
The timing for upstreaming the remaining PREEMPT_RT patches still isn't clear if it will happen for the Linux 6.12 merge window or be held off another cycle, etc. We'll see in the days ahead. In any event with the printk pull request it finishes the long-running work around [2]NBCON consoles.
SUSE engineer Petr Mladek explains of the printk work for Linux 6.12:
"This is the "last" part of the support for the new nbcon consoles. Where "nbcon" stays for "No Big console lock CONsoles" aka not under the console_lock.
New callbacks are added to struct console:
- write_thread() for flushing nbcon consoles in task context.
- write_atomic() for flushing nbcon consoles in atomic context, including NMI.
- con->device_lock() and device_unlock() for taking the driver specific lock, for example, port->lock.
New printk-specific kthreads are created:
- per-console kthreads which get responsible for flushing normal priority messages on nbcon consoles.
- thread which gets responsible for flushing normal priority messages on all consoles when CONFIG_RT enabled.
The new callbacks are called under a special per-console lock which has already been added back in v6.7. It allows to distinguish three severities: normal, emergency, and panic. A context with a higher priority could take over the ownership when it is safe even in the middle of handling a record. The panic context could do it even when it is not safe. But it is allowed only for the final desperate flush before entering the infinite loop.
...
Finally, there is no nbcon console at the moment. It means that the changes should _not_ modify the existing behavior. The only exception is CONFIG_RT which would force offloading the legacy loop, for normal priority context, into the dedicated kthread.
Two thirds of the changes has already been in the pull request for 6.11. The user-visible change is that the flushing is no longer postponed in the emergency sections. The logic has been further simplified by using printk_get_console_flush_type() already at this stage.
The new third of the changes added the write_thread() callback, implemented the kthreads, and updated procfs and sysfs interfaces."
More details for those interested via the [3]printk pull request .
[1] https://www.phoronix.com/news/TIP.GIT-sched-rt-PREEMPT-RT
[2] https://www.phoronix.com/search/NBCON
[3] https://lore.kernel.org/lkml/ZuRRTbapH0DCj334@pathway.suse.cz/
The timing for upstreaming the remaining PREEMPT_RT patches still isn't clear if it will happen for the Linux 6.12 merge window or be held off another cycle, etc. We'll see in the days ahead. In any event with the printk pull request it finishes the long-running work around [2]NBCON consoles.
SUSE engineer Petr Mladek explains of the printk work for Linux 6.12:
"This is the "last" part of the support for the new nbcon consoles. Where "nbcon" stays for "No Big console lock CONsoles" aka not under the console_lock.
New callbacks are added to struct console:
- write_thread() for flushing nbcon consoles in task context.
- write_atomic() for flushing nbcon consoles in atomic context, including NMI.
- con->device_lock() and device_unlock() for taking the driver specific lock, for example, port->lock.
New printk-specific kthreads are created:
- per-console kthreads which get responsible for flushing normal priority messages on nbcon consoles.
- thread which gets responsible for flushing normal priority messages on all consoles when CONFIG_RT enabled.
The new callbacks are called under a special per-console lock which has already been added back in v6.7. It allows to distinguish three severities: normal, emergency, and panic. A context with a higher priority could take over the ownership when it is safe even in the middle of handling a record. The panic context could do it even when it is not safe. But it is allowed only for the final desperate flush before entering the infinite loop.
...
Finally, there is no nbcon console at the moment. It means that the changes should _not_ modify the existing behavior. The only exception is CONFIG_RT which would force offloading the legacy loop, for normal priority context, into the dedicated kthread.
Two thirds of the changes has already been in the pull request for 6.11. The user-visible change is that the flushing is no longer postponed in the emergency sections. The logic has been further simplified by using printk_get_console_flush_type() already at this stage.
The new third of the changes added the write_thread() callback, implemented the kthreads, and updated procfs and sysfs interfaces."
More details for those interested via the [3]printk pull request .
[1] https://www.phoronix.com/news/TIP.GIT-sched-rt-PREEMPT-RT
[2] https://www.phoronix.com/search/NBCON
[3] https://lore.kernel.org/lkml/ZuRRTbapH0DCj334@pathway.suse.cz/
varikonniemi