linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Dragos Tatulea <dtatulea@nvidia.com>
Cc: Mina Almasry <almasrymina@google.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joshua Washington <joshwash@google.com>,
	Harshitha Ramamurthy <hramamurthy@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Simon Horman <horms@kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	ziweixiao@google.com, Vedant Mathur <vedantmathur@google.com>,
	Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net v1 2/2] gve: use max allowed ring size for ZC page_pools
Date: Mon, 10 Nov 2025 12:36:46 +0000	[thread overview]
Message-ID: <ca3899b0-f9b7-4b38-a6fd-a964a1746873@gmail.com> (raw)
In-Reply-To: <k3h635mirxo3wichhpxosw4hxvfu67khqs2jyna3muhhj5pmvm@4t2gypnckuri>

On 11/7/25 13:35, Dragos Tatulea wrote:
> On Thu, Nov 06, 2025 at 05:18:33PM -0800, Jakub Kicinski wrote:
>> On Thu, 6 Nov 2025 17:25:43 +0000 Dragos Tatulea wrote:
>>> On Wed, Nov 05, 2025 at 06:56:46PM -0800, Mina Almasry wrote:
>>>> On Wed, Nov 5, 2025 at 6:22 PM Jakub Kicinski <kuba@kernel.org> wrote:
>>>>> Increasing cache sizes to the max seems very hacky at best.
>>>>> The underlying implementation uses genpool and doesn't even
>>>>> bother to do batching.
>>>>
>>>> OK, my bad. I tried to think through downsides of arbitrarily
>>>> increasing the ring size in a ZC scenario where the underlying memory
>>>> is pre-pinned and allocated anyway, and I couldn't think of any, but I
>>>> won't argue the point any further.
>>>>    
>>> I see a similar issue with io_uring as well: for a 9K MTU with 4K ring
>>> size there are ~1% allocation errors during a simple zcrx test.
>>>
>>> mlx5 calculates 16K pages and the io_uring zcrx buffer matches exactly
>>> that size (16K * 4K). Increasing the buffer doesn't help because the
>>> pool size is still what the driver asked for (+ also the
>>> internal pool limit). Even worse: eventually ENOSPC is returned to the
>>> application. But maybe this error has a different fix.
>>
>> Hm, yes, did you trace it all the way to where it comes from?
>> page pool itself does not have any ENOSPC AFAICT. If the cache
>> is full we free the page back to the provider via .release_netmem
>>
> Yes I did. It happens in io_cqe_cache_refill() when there are no more
> CQEs:
> https://elixir.bootlin.com/linux/v6.17.7/source/io_uring/io_uring.c#L775

-ENOSPC here means io_uring's CQ got full. It's non-fatal, the user
is expected to process completions and reissue the request. And it's
best to avoid that for performance reasons, e.g. by making the CQ
bigger as you already noted.

-- 
Pavel Begunkov


  parent reply	other threads:[~2025-11-10 12:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 20:07 [PATCH net v1 1/2] page_pool: expose max page pool ring size Mina Almasry
2025-11-05 20:07 ` [PATCH net v1 2/2] gve: use max allowed ring size for ZC page_pools Mina Almasry
2025-11-05 21:58   ` Jesper Dangaard Brouer
2025-11-05 22:44     ` Mina Almasry
2025-11-05 22:15   ` Harshitha Ramamurthy
2025-11-05 22:46     ` Mina Almasry
2025-11-06  1:11   ` Jakub Kicinski
2025-11-06  1:56     ` Mina Almasry
2025-11-06  2:22       ` Jakub Kicinski
2025-11-06  2:56         ` Mina Almasry
2025-11-06 17:25           ` Dragos Tatulea
2025-11-07  1:18             ` Jakub Kicinski
2025-11-07 13:35               ` Dragos Tatulea
2025-11-08  2:04                 ` Jakub Kicinski
2025-11-10 12:36                 ` Pavel Begunkov [this message]
2025-11-10 12:48                   ` Dragos Tatulea
2025-11-05 21:56 ` [PATCH net v1 1/2] page_pool: expose max page pool ring size Jesper Dangaard Brouer
2025-11-05 22:56   ` Mina Almasry
2025-11-06 13:12 ` Ilias Apalodimas

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=ca3899b0-f9b7-4b38-a6fd-a964a1746873@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=hramamurthy@google.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=joshwash@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vedantmathur@google.com \
    --cc=willemb@google.com \
    --cc=ziweixiao@google.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).