linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] netconsole: Allow userdata buffer to grow dynamically
@ 2025-11-05 17:06 Gustavo Luiz Duarte
  2025-11-05 17:06 ` [PATCH net-next 1/4] netconsole: Simplify send_fragmented_body() Gustavo Luiz Duarte
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Gustavo Luiz Duarte @ 2025-11-05 17:06 UTC (permalink / raw)
  To: Breno Leitao, Andre Carvalho, Simon Horman, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Shuah Khan
  Cc: netdev, linux-kernel, linux-kselftest, Gustavo Luiz Duarte

The current netconsole implementation allocates a static buffer for
extradata (userdata + sysdata) with a fixed size of
MAX_EXTRADATA_ENTRY_LEN * MAX_EXTRADATA_ITEMS bytes for every target,
regardless of whether userspace actually uses this feature. This forces
us to keep MAX_EXTRADATA_ITEMS small (16), which is restrictive for
users who need to attach more metadata to their log messages.

This patch series enables dynamic allocation of the userdata buffer,
allowing it to grow on-demand based on actual usage. The series:

1. Refactors send_fragmented_body() to simplify handling of separated
   userdata and sysdata (patch 1/4)
2. Splits userdata and sysdata into separate buffers (patch 2/4)
3. Implements dynamic allocation for the userdata buffer (patch 3/4)
4. Increases MAX_USERDATA_ITEMS from 16 to 256 now that we can do so
   without memory waste (patch 4/4)

Benefits:
- No memory waste when userdata is not used
- Targets that use userdata only consume what they need
- Users can attach significantly more metadata without impacting systems
  that don't use this feature

Signed-off-by: Gustavo Luiz Duarte <gustavold@gmail.com>
---
Gustavo Luiz Duarte (4):
      netconsole: Simplify send_fragmented_body()
      netconsole: Split userdata and sysdata
      netconsole: Dynamic allocation of userdata buffer
      netconsole: Increase MAX_USERDATA_ITEMS

 drivers/net/netconsole.c                           | 338 +++++++++------------
 .../selftests/drivers/net/netcons_overflow.sh      |   2 +-
 2 files changed, 152 insertions(+), 188 deletions(-)
---
base-commit: 89aec171d9d1ab168e43fcf9754b82e4c0aef9b9
change-id: 20251007-netconsole_dynamic_extradata-21bd9d726568

Best regards,
-- 
Gustavo Duarte <gustavold@meta.com>


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

end of thread, other threads:[~2025-11-07 20:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05 17:06 [PATCH net-next 0/4] netconsole: Allow userdata buffer to grow dynamically Gustavo Luiz Duarte
2025-11-05 17:06 ` [PATCH net-next 1/4] netconsole: Simplify send_fragmented_body() Gustavo Luiz Duarte
2025-11-07 12:15   ` Breno Leitao
2025-11-07 19:48     ` Gustavo Luiz Duarte
2025-11-05 17:06 ` [PATCH net-next 2/4] netconsole: Split userdata and sysdata Gustavo Luiz Duarte
2025-11-07 13:23   ` Breno Leitao
2025-11-07 20:53     ` Gustavo Luiz Duarte
2025-11-05 17:06 ` [PATCH net-next 3/4] netconsole: Dynamic allocation of userdata buffer Gustavo Luiz Duarte
2025-11-05 17:06 ` [PATCH net-next 4/4] netconsole: Increase MAX_USERDATA_ITEMS Gustavo Luiz Duarte

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).