Re: [RFC net-next] net: page_pool: cap alloc cache size and refill by pool ring size
From: Nimrod Oren
Date: Thu Feb 26 2026 - 10:52:25 EST
On 25/02/2026 1:39, Jakub Kicinski wrote:
> I'd simply change the defines based on PAGE_SIZE. The allocation batch
> size has nothing to do with the ring size, it's just amortizing
> allocations within a single NAPI cycle.
Thanks, that sounds good to me.
Do you think a formula like this would work?
#define PP_ALLOC_CACHE_REFILL ((64 * SZ_4K) / PAGE_SIZE)
#define PP_ALLOC_CACHE_SIZE (PP_ALLOC_CACHE_REFILL * 2)
It keeps both values constant in bytes across page sizes, ensuring a
consistent memory footprint for pool alloc-caches regardless of a
system's page size.