On 2026-02-03, Breno Leitao [off-list ref] wrote:
This series adds support for the nbcon (new buffer console) infrastructure
to netconsole, enabling lock-free, priority-based console operations that
are safer in crash scenarios.
The implementation is introduced in three steps:
0) Extend printk to expose CPU and taskname (task->comm) where the
printk originated from. (Thanks John and Petr for the support in
getting this done)
1) Refactor the message fragmentation logic into a reusable helper function
2) Extend nbcon support to non-extended (basic) consoles using the same
infrastructure.
The initial discussion about it appeared a while ago in [1], in order to
solve Mike's HARDIRQ-safe -> HARDIRQ-unsafe lock order warning, and the root
cause is that some hosts were calling IRQ unsafe locks from inside console
lock.
At that time, we didn't have the CON_NBCON_ATOMIC_UNSAFE yet. John
kindly implemented CON_NBCON_ATOMIC_UNSAFE in 187de7c212e5 ("printk:
nbcon: Allow unsafe write_atomic() for panic"), and now we can
implement netconsole on top of nbcon.
Important to note that netconsole continues to call netpoll and the
network TX helpers with interrupt disable, given the TX are called with
target_list_lock.
Netdev maintainers, Petr suggested that this patchset goes through netdev[2]
Link: https://lore.kernel.org/all/b2qps3uywhmjaym4mht2wpxul4yqtuuayeoq4iv4k3zf5wdgh3@tocu6c7mj4lt/ (local) [1]
Link: https://lore.kernel.org/all/aW9D5M0o9_8hdVvt@pathway.suse.cz/ (local) [2]
Signed-off-by: Breno Leitao <leitao@debian.org>
---
Changes in v6:
- Do not select PRINTK_EXECUTION_CTX in NETCONSOLE_DYNAMIC (Jakub)
- Do not make PRINTK_EXECUTION_CTX user visible (Jakub)
I am really sorry, but I failed to communicate what I meant about
introducing the CONSOLE_HAS_EXECUTION_CTX symbol.
As Jakub mentioned, NETCONSOLE_DYNAMIC should just directly select
PRINTK_EXECUTION_CTX and get rid of the CONSOLE_HAS_EXECUTION_CTX symbol
(like you had in v1).
I apologize for the confusion and wasted effort here.
John