diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2026-02-10 19:51:59 -0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-02-10 19:52:00 -0800 |
| commit | f2c7fdebf03986cd820028ab933afad670bfe8a2 (patch) | |
| tree | 33b3a4f5f09701f3b08b5661b065e9dc5978c93d /include/linux | |
| parent | ad1f18e985cb2758c60f644c8fbc92a97bb6d2ba (diff) | |
| parent | 79ba362b43373d19ce6c989b0498f7a67740ff6e (diff) | |
Merge branch 'net-netconsole-convert-to-nbcon-console-infrastructure'
Breno Leitao says:
====================
net: netconsole: convert to NBCON console infrastructure
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.
====================
Link: https://patch.msgid.link/20260206-nbcon-v7-0-62bda69b1b41@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/console.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/console.h b/include/linux/console.h index fc9f5c5c1b04..cc5dc3bf58b6 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -298,12 +298,20 @@ struct nbcon_context { * @outbuf: Pointer to the text buffer for output * @len: Length to write * @unsafe_takeover: If a hostile takeover in an unsafe state has occurred + * @cpu: CPU on which the message was generated + * @pid: PID of the task that generated the message + * @comm: Name of the task that generated the message */ struct nbcon_write_context { struct nbcon_context __private ctxt; char *outbuf; unsigned int len; bool unsafe_takeover; +#ifdef CONFIG_PRINTK_EXECUTION_CTX + int cpu; + pid_t pid; + char comm[TASK_COMM_LEN]; +#endif }; /** |
