Netdev List
 help / color / mirror / Atom feed
* [PATCH 0/9] netconsole: stop charging every netpoll user for netconsole-only state
@ 2026-05-24 16:12 Breno Leitao
  2026-05-24 16:12 ` [PATCH 1/9] netpoll: export refill_skbs(), refill_skbs_work_handler(), skb_pool_flush() Breno Leitao
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Breno Leitao @ 2026-05-24 16:12 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Andrew Lunn
  Cc: netdev, linux-kernel, gustavold, asantostc, Breno Leitao,
	kernel-team

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.
  - local_ip / remote_ip / ipv6: the source and destination IP
    addresses and the family selector for the same packets.

Every netpoll user that allocates a struct netpoll and 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.

The fix is to move 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 genuinely belongs to the generic poll/transmit
abstraction or what netpoll core still has to read itself.

Follow-ups
----------

local_ip, remote_ip and ipv6 are still in struct netpoll, as they are
left for a follow-up posting to keep each series focused on a single
responsibility transfer.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
Breno Leitao (9):
      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 from struct netpoll to netconsole_target
      netconsole: move remote_port from struct netpoll to netconsole_target
      netconsole: move remote_mac from struct netpoll to netconsole_target

 drivers/net/netconsole.c | 188 ++++++++++++++++++++++++++++++++++++-----------
 include/linux/netpoll.h  |   4 -
 net/core/netpoll.c       |  58 +--------------
 3 files changed, 145 insertions(+), 105 deletions(-)
---
base-commit: 150061a2065192d77a4f6518b6238be81dfb8321
change-id: 20260514-netconsole_move_more-888fde03dfc7

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


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

end of thread, other threads:[~2026-05-27  9:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-24 16:12 [PATCH 0/9] netconsole: stop charging every netpoll user for netconsole-only state Breno Leitao
2026-05-24 16:12 ` [PATCH 1/9] netpoll: export refill_skbs(), refill_skbs_work_handler(), skb_pool_flush() Breno Leitao
2026-05-24 16:12 ` [PATCH 2/9] netconsole: take over skb pool lifecycle from netpoll Breno Leitao
2026-05-24 16:12 ` [PATCH 3/9] netconsole: move refill_skbs_work_handler() " Breno Leitao
2026-05-24 16:12 ` [PATCH 4/9] netconsole: move refill_skbs() and skb-pool sizing macros " Breno Leitao
2026-05-24 16:12 ` [PATCH 5/9] netconsole: move skb_pool_flush() " Breno Leitao
2026-05-24 16:12 ` [PATCH 6/9] netconsole: move skb_pool / refill_wq from struct netpoll to netconsole_target Breno Leitao
2026-05-24 16:12 ` [PATCH 7/9] netconsole: move local_port " Breno Leitao
2026-05-24 16:12 ` [PATCH 8/9] netconsole: move remote_port " Breno Leitao
2026-05-24 16:12 ` [PATCH 9/9] netconsole: move remote_mac " Breno Leitao
2026-05-27  2:00 ` [PATCH 0/9] netconsole: stop charging every netpoll user for netconsole-only state Jakub Kicinski
2026-05-27  9:07   ` Breno Leitao

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