netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: netpoll: Improve SKB pool management
@ 2024-10-25 14:20 Breno Leitao
  2024-10-25 14:20 ` [PATCH net-next 1/3] net: netpoll: Defer skb_pool population until setup success Breno Leitao
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Breno Leitao @ 2024-10-25 14:20 UTC (permalink / raw)
  To: kuba, horms, davem, edumazet, pabeni
  Cc: thepacketgeek, netdev, linux-kernel, davej, vlad.wing, max,
	kernel-team, jiri, jv, andy, aehkn

The netpoll subsystem pre-allocates 32 SKBs in a pool for emergency use
during out-of-memory conditions. However, the current implementation has
several inefficiencies:

 * The SKB pool, once allocated, is never freed:
	 * Resources remain allocated even after netpoll users are removed
	 * Failed initialization can leave pool populated forever
 * The global pool design makes resource tracking difficult

This series addresses these issues through three patches:


Patch 1 ("net: netpoll: Defer skb_pool population until setup success"):
 - Defer SKB pool population until setup validation passes

Patch 2 ("net: netpoll: Individualize the skb pool"):
 - Replace global pool with per-user pools in netpoll struct

Patch 3 ("net: netpoll: flush skb pool during cleanup"):
- Properly free pool resources during netconsole cleanup

These changes improve resource management and make the code more
maintainable.  As a side benefit, the improved structure would allow
netpoll to be modularized if desired in the future.

What is coming next?

Once this patch is integrated, I am planning to have the SKBs being
refilled outside of hot (send) path, in a work thread.

Breno Leitao (3):
  net: netpoll: Defer skb_pool population until setup success
  net: netpoll: Individualize the skb pool
  net: netpoll: flush skb pool during cleanup

 include/linux/netpoll.h |  1 +
 net/core/netpoll.c      | 52 +++++++++++++++++++++++++----------------
 2 files changed, 33 insertions(+), 20 deletions(-)

-- 
2.43.5


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

end of thread, other threads:[~2024-11-07 11:50 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25 14:20 [PATCH net-next 0/3] net: netpoll: Improve SKB pool management Breno Leitao
2024-10-25 14:20 ` [PATCH net-next 1/3] net: netpoll: Defer skb_pool population until setup success Breno Leitao
2024-11-01  1:26   ` Jakub Kicinski
2024-11-01 10:51     ` Breno Leitao
2024-11-01 18:18       ` Breno Leitao
2024-11-02  2:01         ` Jakub Kicinski
2024-11-04 20:40           ` Breno Leitao
2024-11-06  1:00             ` Jakub Kicinski
2024-11-06 15:06               ` Breno Leitao
2024-11-06 23:43                 ` Jakub Kicinski
2024-11-07 11:50                   ` Breno Leitao
2024-10-25 14:20 ` [PATCH net-next 2/3] net: netpoll: Individualize the skb pool Breno Leitao
2024-11-01  1:28   ` Jakub Kicinski
2024-11-01 11:56     ` Breno Leitao
2024-10-25 14:20 ` [PATCH net-next 3/3] net: netpoll: flush skb pool during cleanup Breno Leitao
2024-11-01  1:29   ` Jakub Kicinski
2024-11-01 11:57     ` Breno Leitao

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