lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241107-skb_buffers_v2-v2-0-288c6264ba4f@debian.org>
Date: Thu, 07 Nov 2024 07:57:05 -0800
From: Breno Leitao <leitao@...ian.org>
To: "David S. Miller" <davem@...emloft.net>, 
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, 
 Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Breno Leitao <leitao@...ian.org>
Subject: [PATCH net-next v2 0/2] net: netpoll: Improve SKB pool management

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: Individualize the skb pool"):
 - Replace global pool with per-user pools in netpoll struct

Patch 2 ("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.

Changelog:

v2:
 * Drop the very first patch from v1 ("net: netpoll: Defer skb_pool
   population until setup success") (Jakub)
 * Move skb_queue_head_init() to the first patch, where it belongs to
   (Jakub)

v1:
 * https://lore.kernel.org/all/20241025142025.3558051-1-leitao@debian.org/

Signed-off-by: Breno Leitao <leitao@...ian.org>
---
Breno Leitao (2):
      net: netpoll: Individualize the skb pool
      net: netpoll: flush skb pool during cleanup

 include/linux/netpoll.h |  1 +
 net/core/netpoll.c      | 53 +++++++++++++++++++++++++++++++------------------
 2 files changed, 35 insertions(+), 19 deletions(-)
---
base-commit: 2575897640328d218e4451d2c6f2741ae894ed27
change-id: 20241107-skb_buffers_v2-f3e626100eda

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ