netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] netconsole: Add support for CPU population
@ 2024-11-13 15:10 Breno Leitao
  2024-11-13 15:10 ` [PATCH net-next 1/4] netconsole: Ensure dynamic_netconsole_mutex is held during userdata update Breno Leitao
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Breno Leitao @ 2024-11-13 15:10 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Jonathan Corbet, Shuah Khan
  Cc: netdev, linux-kernel, linux-doc, linux-kselftest, Breno Leitao,
	max, thepacketgeek, vlad.wing, davej

The current implementation of netconsole sends all log messages in
parallel, which can lead to an intermixed and interleaved output on the
receiving side. This makes it challenging to demultiplex the messages
and attribute them to their originating CPUs.

As a result, users and developers often struggle to effectively analyze
and debug the parallel log output received through netconsole.

Example of a message got from produciton hosts:

	------------[ cut here ]------------
	------------[ cut here ]------------
	refcount_t: saturated; leaking memory.
	WARNING: CPU: 2 PID: 1613668 at lib/refcount.c:22 refcount_warn_saturate+0x5e/0xe0
	refcount_t: addition on 0; use-after-free.
	WARNING: CPU: 26 PID: 4139916 at lib/refcount.c:25 refcount_warn_saturate+0x7d/0xe0
	Modules linked in: bpf_preload(E) vhost_net(E) tun(E) vhost(E)

This series of patches introduces a new feature to the netconsole
subsystem that allows the automatic population of the CPU number in the
userdata field for each log message. This enhancement provides several
benefits:

* Improved demultiplexing of parallel log output: When multiple CPUs are
  sending messages concurrently, the added CPU number in the userdata
  makes it easier to differentiate and attribute the messages to their
  originating CPUs.

* Better visibility into message sources: The CPU number information
  gives users and developers more insight into which specific CPU a
  particular log message came from, which can be valuable for debugging
  and analysis.

The changes in this series are as follows:

Patch "Ensure dynamic_netconsole_mutex is held during userdata update"

Add a lockdep assert to make sure  dynamic_netconsole_mutex is held when
calling update_userdata().

Patch "netconsole: Add option to auto-populate CPU number in userdata"

Adds a new option to enable automatic CPU number population in the
netconsole userdata Provides a new "populate_cpu_nr" sysfs attribute to
control this feature

Patch "netconsole: selftest: test CPU number auto-population"

Expands the existing netconsole selftest to verify the CPU number
auto-population functionality Ensures the received netconsole messages
contain the expected "cpu=" entry in the userdata

Patch "netconsole: docs: Add documentation for CPU number auto-population"

Updates the netconsole documentation to explain the new CPU number
auto-population feature Provides instructions on how to enable and use
the feature

I believe these changes will be a valuable addition to the netconsole
subsystem, enhancing its usefulness for kernel developers and users.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
Breno Leitao (4):
      netconsole: Ensure dynamic_netconsole_mutex is held during userdata update
      netconsole: Add option to auto-populate CPU number in userdata
      netconsole: docs: Add documentation for CPU number auto-population
      netconsole: selftest: Validate CPU number auto-population in userdata

 Documentation/networking/netconsole.rst            | 44 +++++++++++++++
 drivers/net/netconsole.c                           | 63 ++++++++++++++++++++++
 .../testing/selftests/drivers/net/netcons_basic.sh | 18 +++++++
 3 files changed, 125 insertions(+)
---
base-commit: a58f00ed24b849d449f7134fd5d86f07090fe2f5
change-id: 20241108-netcon_cpu-ce3917e88f4b

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


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

end of thread, other threads:[~2024-12-04 16:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-13 15:10 [PATCH net-next 0/4] netconsole: Add support for CPU population Breno Leitao
2024-11-13 15:10 ` [PATCH net-next 1/4] netconsole: Ensure dynamic_netconsole_mutex is held during userdata update Breno Leitao
2024-11-13 15:10 ` [PATCH net-next 2/4] netconsole: Add option to auto-populate CPU number in userdata Breno Leitao
2024-11-19  2:33   ` Jakub Kicinski
2024-11-19 17:07     ` Breno Leitao
2024-12-04 16:52       ` Breno Leitao
2024-11-13 15:10 ` [PATCH net-next 3/4] netconsole: docs: Add documentation for CPU number auto-population Breno Leitao
2024-11-13 15:10 ` [PATCH net-next 4/4] netconsole: selftest: Validate CPU number auto-population in userdata Breno Leitao
2024-11-19  2:35   ` 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).