netconsole: stop charging netpoll users for netconsole-only data
Status from this message: This series was applied to netdev/net-next.git (main)
Get series with b4
b4 am [email protected] change-id 20260514-netconsole_move_more-888fde03dfc7Versions newest first
- v3 Latest9 patches 1 replyApplied 9/9
- v28 patches 7 repliesSuperseded
- v19 patches 4 repliesSuperseded
Changes in v3 from the cover letter
- Added a fix for a pre-existing cleanup-skip leak (released/joined targets).
- Added an skb-pool init-once patch closing an init/teardown race; rebased.
- Link to v2: https://lore.kernel.org/r/[email protected]
Patches in v3 All 9 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | netconsole: clean up released targets dropped before the cleanup workerdrivers/ | +7 | 0 replies | Applied |
| 2/9 | netpoll: export refill_skbs(), refill_skbs_work_handler(), skb_pool_flush()include/ net/ | +9 | 0 replies | Applied |
| 3/9 | netconsole: take over skb pool lifecycle from netpolldrivers/ net/ | +52 | 0 replies | Applied |
| 4/9 | netconsole: move refill_skbs_work_handler() from netpolldrivers/ include/ net/ | +8 | 0 replies | Applied |
| 5/9 | netconsole: move refill_skbs() and skb-pool sizing macros from netpolldrivers/ include/ net/ | +29 | 0 replies | Applied |
| 6/9 | netconsole: move skb_pool_flush() from netpolldrivers/ include/ net/ | +4 | 0 replies | Applied |
| 7/9 | netconsole: move skb_pool / refill_wq from struct netpoll to netconsole_targetdrivers/ include/ | +30 | 0 replies | Applied |
| 8/9 | netconsole: move local_port / remote_port from struct netpoll to netconsole_targetdrivers/ include/ | +26 | 0 replies | Applied |
| 9/9 | netconsole: move remote_mac from struct netpoll to netconsole_targetdrivers/ include/ | +11 | 0 replies | Applied |
Reviews trailers per patch
None of the 9 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Simon Horman |
|---|---|
| Series | R-b R-b |
| 1/9 | |
| 2/9 | |
| 3/9 | |
| 4/9 | |
| 5/9 | |
| 6/9 | |
| 7/9 | |
| 8/9 | |
| 9/9 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next v3 0/9] netconsole: stop charging netpoll users for netconsole-only data
This work continue to untangle netconsole and netpoll, improving memory usage for netpoll users that are not netconsole.
struct netpoll is shared by every netpoll consumer in the tree:
bonding, bridge, team, vlan, macvlan, dsa and netconsole. The non- netconsole users only need a per-port handle that lets them transmit SKBs.
Yet struct netpoll has accumulated a pile of fields that exist only to serve netconsole's printk path:
- skb_pool / refill_wq: the fallback skb pool find_skb() falls back on when alloc_skb() returns NULL, plus the workqueue that refills it.
- local_port / remote_port / remote_mac: the source and destination UDP ports and the destination ethernet address used to build outgoing log packets.
Every netpoll user that allocates a struct netpoll pays for all of these fields, even though it never queues a single skb on the pool, never sends a UDP frame and never looks at any of the addressing.
Move this netconsole-only state out of the shared struct into struct netconsole_target, where its only consumer already lives.
After the series every passive netpoll consumer drops sizeof(sk_buff_head) + sizeof(work_struct) + 2 * sizeof(u16) + ETH_ALEN bytes per port (plus padding), and struct netpoll keeps only what belongs to the generic poll/transmit abstraction or what netpoll core still reads itself.
Follow-ups
----------local_ip, remote_ip and ipv6 are still in struct netpoll. Moving the addressing additionally requires relocating netpoll_setup() -- whose only caller is netconsole -- and its IPv4/IPv6 helpers, so it is left for a follow-up to keep this series focused on a single responsibility transfer.
This is pure code motion with no functional change. The pre-existing target/device teardown races reported against v1 have since been fixed independently (as suggested by Jakub) and are already in the tree, so, re-posting this one.
--
Changes in v3:
- Added a fix for a pre-existing cleanup-skip leak (released/joined targets).
- Added an skb-pool init-once patch closing an init/teardown race; rebased.
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Rebase on net-next, now that the prerequisite netconsole
teardown-race fixes are merged.
- Squash the local_port and remote_port moves into a single patch.
- v1: https://lore.kernel.org/r/[email protected]
To: David S. Miller <[email protected]>
To: Eric Dumazet <[email protected]>
To: Jakub Kicinski <[email protected]>
To: Paolo Abeni <[email protected]>
To: Simon Horman <[email protected]>
To: Andrew Lunn <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
Breno Leitao (9):
netconsole: clean up released targets dropped before the cleanup worker
netpoll: export refill_skbs(), refill_skbs_work_handler(), skb_pool_flush()
netconsole: take over skb pool lifecycle from netpoll
netconsole: move refill_skbs_work_handler() from netpoll
netconsole: move refill_skbs() and skb-pool sizing macros from netpoll
netconsole: move skb_pool_flush() from netpoll
netconsole: move skb_pool / refill_wq from struct netpoll to netconsole_target
netconsole: move local_port / remote_port from struct netpoll to netconsole_target
netconsole: move remote_mac from struct netpoll to netconsole_target
drivers/net/netconsole.c | 199 +++++++++++++++++++++++++++++++++++------------ include/linux/netpoll.h | 18 ----- net/core/netpoll.c | 51 +----------- 3 files changed, 152 insertions(+), 116 deletions(-)
---
base-commit: 34cf6dafc47441dfb6b356a095b89c3585a93714
change-id: 20260514-netconsole_move_more-888fde03dfc7
Best regards,
Signature · 1 line
Breno Leitao <[email protected]>