netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: horms@kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, thepacketgeek@gmail.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	davej@codemonkey.org.uk, vlad.wing@gmail.com, max@kutsevol.com,
	kernel-team@meta.com, jiri@resnulli.us, jv@jvosburgh.net,
	andy@greyhouse.net, aehkn@xenhub.one,
	Rik van Riel <riel@surriel.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH net-next 1/3] net: netpoll: Defer skb_pool population until setup success
Date: Tue, 5 Nov 2024 17:00:29 -0800	[thread overview]
Message-ID: <20241105170029.719344e7@kernel.org> (raw)
In-Reply-To: <20241104-nimble-scallop-of-justice-4ab82f@leitao>

On Mon, 4 Nov 2024 12:40:00 -0800 Breno Leitao wrote:
> Let's assume the pool is full and we start getting OOMs. It doesn't
> matter if alloc_skb() will fail in the critical path or in the work
> thread, netpoll will have MAX_SKBS skbs buffered to use, and none will
> be allocated, thus, just 32 SKBs will be used until a -ENOMEM returns.

Do you assume the worker thread will basically keep up with the output?
Vadim was showing me a system earlier today where workqueue workers
didn't get scheduled in for minutes :( That's a bit extreme but doesn't
inspire confidence in worker replenishing the pool quickly.

> On the other side, let's suppose there is a bunch of OOM pressure for a
> while (10 SKBs are consumed for instance), and then some free memory
> show up, causing the pool to be replenished. It is better
> to do it in the workthread other than in the hot path.

We could cap how much we replenish in one go?

> In both cases, the chance of not having SKBs to send the packet seems to
> be the same, unless I am not modeling the problem correctly.

Maybe I misunderstood the proposal, I think you said earlier that you
want to consume from the pool instead of calling alloc(). If you mean
that we'd still alloc in the fast path but not replenish the pool
that's different.

> On top of that, a few other points that this new model could help more,
> in a OOM case.
> 
> 1) Now with Maksysm patches, we can monitor the OOMing rate
> 
> 2) With the pool per target, we can easily increase the pool size if we
> want. (patchset not pushed yet)


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

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20241105170029.719344e7@kernel.org \
    --to=kuba@kernel.org \
    --cc=aehkn@xenhub.one \
    --cc=andy@greyhouse.net \
    --cc=davej@codemonkey.org.uk \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=jv@jvosburgh.net \
    --cc=kernel-team@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max@kutsevol.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=riel@surriel.com \
    --cc=thepacketgeek@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --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;
as well as URLs for NNTP newsgroup(s).