public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/5] net: netconsole: convert to NBCON console infrastructure
@ 2026-01-20 16:23 Breno Leitao
  2026-01-20 16:23 ` [PATCH net-next v2 1/5] printk: Add execution context (task name/CPU) to printk_info Breno Leitao
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Breno Leitao @ 2026-01-20 16:23 UTC (permalink / raw)
  To: Breno Leitao, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, pmladek, john.ogness
  Cc: Greg Kroah-Hartman, Steven Rostedt, Sergey Senozhatsky,
	Andrew Morton, netdev, linux-kernel, asantostc, efault, gustavold,
	calvin, jv, mpdesouza, kernel-team, Simon Horman

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/ [1]
Link: https://lore.kernel.org/all/aW9D5M0o9_8hdVvt@pathway.suse.cz/ [2]

Signed-off-by: Breno Leitao <leitao@debian.org>

---
Changes in v2:
- Return if not able to nbcon_enter_unsafe() instead of retrying on
  a different target (Marcos)
- Add printk that supports context information, which will be used later
  by netconsole sysdata. (John, Petr)
- An extra patch to bring symmetry to send_msg_udp()
- Link to v1: https://patch.msgid.link/20251222-nbcon-v1-0-65b43c098708@debian.org

Changes in V1 from RFC:
  * Removed the extra CONFIG for NBCON, given we don't want to support
    both console. Move to nbcon as the only console framework supported
  * Incorporated the changes from Petr.
  * Some renames to make the code more consistent.
  * RFC Link: https://lore.kernel.org/all/20251121-nbcon-v1-0-503d17b2b4af@debian.org/

---
Breno Leitao (5):
      printk: Add execution context (task name/CPU) to printk_info
      netconsole: extract message fragmentation into send_msg_udp()
      netconsole: convert to NBCON console infrastructure
      netconsole: Use printk context for CPU and task information
      netconsole: pass wctxt to send_msg_udp() for consistency

 drivers/net/Kconfig               |   1 +
 drivers/net/netconsole.c          | 147 +++++++++++++++++++++++---------------
 include/linux/console.h           |   8 +++
 kernel/printk/internal.h          |   8 +++
 kernel/printk/nbcon.c             |  15 ++++
 kernel/printk/printk.c            |  52 +++++++++++++-
 kernel/printk/printk_ringbuffer.h |   4 ++
 lib/Kconfig.debug                 |  20 ++++++
 8 files changed, 197 insertions(+), 58 deletions(-)
---
base-commit: 956f569c90ab507559342d289f4c923adfbf06f5
change-id: 20251117-nbcon-f24477ca9f3e

Best regards,
--  
Breno Leitao <leitao@debian.org>


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-01-23 18:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-20 16:23 [PATCH net-next v2 0/5] net: netconsole: convert to NBCON console infrastructure Breno Leitao
2026-01-20 16:23 ` [PATCH net-next v2 1/5] printk: Add execution context (task name/CPU) to printk_info Breno Leitao
2026-01-21 11:41   ` Breno Leitao
2026-01-20 16:23 ` [PATCH net-next v2 2/5] netconsole: extract message fragmentation into send_msg_udp() Breno Leitao
2026-01-20 16:23 ` [PATCH net-next v2 3/5] netconsole: convert to NBCON console infrastructure Breno Leitao
2026-01-22 21:09   ` Simon Horman
2026-01-23 10:48     ` Breno Leitao
2026-01-23 18:04       ` Simon Horman
2026-01-20 16:23 ` [PATCH net-next v2 4/5] netconsole: Use printk context for CPU and task information Breno Leitao
2026-01-21  5:40   ` kernel test robot
2026-01-20 16:23 ` [PATCH net-next v2 5/5] netconsole: pass wctxt to send_msg_udp() for consistency Breno Leitao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox