mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Breno Leitao <leitao@debian.org>,
	max@kutsevol.com, davej@codemonkey.org.uk,  vlad.wing@gmail.com
Subject: [PATCH net-next v3 0/2] net: netpoll: Improve SKB pool management
Date: Thu, 14 Nov 2024 03:00:10 -0800	[thread overview]
Message-ID: <20241114-skb_buffers_v2-v3-0-9be9f52a8b69@debian.org> (raw)

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.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
Changelog:
v3:
 * Use the skb_queue_purge_reason() helper instead of dropping the skb
   pool manually. (Jakub)

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)
 * https://lore.kernel.org/all/20241107-skb_buffers_v2-v2-0-288c6264ba4f@debian.org/

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

- Link to v2: https://lore.kernel.org/r/20241107-skb_buffers_v2-v2-0-288c6264ba4f@debian.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      | 45 ++++++++++++++++++++++++++-------------------
 2 files changed, 27 insertions(+), 19 deletions(-)
---
base-commit: a71c69f51d1119db5f7812b35f16e8ef7786b3f2
change-id: 20241107-skb_buffers_v2-f3e626100eda

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


             reply	other threads:[~2024-11-14 11:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 11:00 Breno Leitao [this message]
2024-11-14 11:00 ` [PATCH net-next v3 1/2] net: netpoll: Individualize the skb pool Breno Leitao
2024-11-14 11:00 ` [PATCH net-next v3 2/2] net: netpoll: flush skb pool during cleanup Breno Leitao
2024-11-16  2:00 ` [PATCH net-next v3 0/2] net: netpoll: Improve SKB pool management patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241114-skb_buffers_v2-v3-0-9be9f52a8b69@debian.org \
    --to=leitao@debian.org \
    --cc=davej@codemonkey.org.uk \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max@kutsevol.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vlad.wing@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®