linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/4] netconsole: Optimize console registration and improve testing
@ 2025-06-02 10:34 Breno Leitao
  2025-06-02 10:34 ` [PATCH net-next v2 1/4] netconsole: Only register console drivers when targets are configured Breno Leitao
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Breno Leitao @ 2025-06-02 10:34 UTC (permalink / raw)
  To: Breno Leitao, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Tejun Heo, Andrew Morton, Shuah Khan,
	horms
  Cc: netdev, linux-kernel, gustavold, Usama Arif, linux-kselftest,
	kernel-team

During performance analysis of console subsystem latency, I discovered that
netconsole registers console handlers even when no active targets exist.
These orphaned console handlers are invoked on every printk() call, get
the lock, iterate through empty target lists, and consume CPU cycles
without performing any useful work.

This patch series addresses the inefficiency by:

1. Implementing dynamic console registration/unregistration based on target
   availability, ensuring console handlers are only active when needed
2. Adding automatic cleanup of unused console registrations when targets
   are disabled or removed
3. Extending the selftest suite to cover non-extended console format,
   which was previously untested

The optimization reduces printk() overhead by eliminating unnecessary
function calls and list traversals when netconsole targets are not
configured, improving overall system performance during heavy logging
scenarios.

---
Changes in v2:
- Added selftests to test the new mechanism
- Unregister the console if the last target got disabled
- Sending to net-next instead of net (Jakub)
- Link to v1: https://lore.kernel.org/r/20250528-netcons_ext-v1-1-69f71e404e00@debian.org

---
Breno Leitao (4):
      netconsole: Only register console drivers when targets are configured
      netconsole: Add automatic console unregistration on target removal
      selftests: netconsole: Do not exit from inside the validation function
      selftests: netconsole: Add support for basic netconsole target format

 drivers/net/netconsole.c                           | 61 +++++++++++++++++++---
 .../selftests/drivers/net/lib/sh/lib_netcons.sh    | 27 ++++++++--
 .../testing/selftests/drivers/net/netcons_basic.sh | 50 +++++++++++-------
 3 files changed, 107 insertions(+), 31 deletions(-)
---
base-commit: 914873bc7df913db988284876c16257e6ab772c6
change-id: 20250528-netcons_ext-572982619bea

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


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

end of thread, other threads:[~2025-06-02 14:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-02 10:34 [PATCH net-next v2 0/4] netconsole: Optimize console registration and improve testing Breno Leitao
2025-06-02 10:34 ` [PATCH net-next v2 1/4] netconsole: Only register console drivers when targets are configured Breno Leitao
2025-06-02 10:34 ` [PATCH net-next v2 2/4] netconsole: Add automatic console unregistration on target removal Breno Leitao
2025-06-02 10:34 ` [PATCH net-next v2 3/4] selftests: netconsole: Do not exit from inside the validation function Breno Leitao
2025-06-02 10:34 ` [PATCH net-next v2 4/4] selftests: netconsole: Add support for basic netconsole target format Breno Leitao
2025-06-02 14:57 ` [PATCH net-next v2 0/4] netconsole: Optimize console registration and improve testing Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).