[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250918091341.n6_OgbOW@linutronix.de>
Date: Thu, 18 Sep 2025 11:13:41 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Dragos Tatulea <dtatulea@...dia.com>
Cc: Jesper Dangaard Brouer <hawk@...nel.org>,
"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>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
Clark Williams <clrkwllms@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>, netdev@...r.kernel.org,
Tariq Toukan <tariqt@...dia.com>, linux-kernel@...r.kernel.org,
linux-rt-devel@...ts.linux.dev
Subject: Re: [PATCH net-next] page_pool: add debug for release to cache from
wrong CPU
On 2025-09-18 11:48:21 [+0300], Dragos Tatulea wrote:
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> index ba70569bd4b0..404064d893d6 100644
> --- a/net/core/page_pool.c
> +++ b/net/core/page_pool.c
> @@ -768,6 +795,18 @@ static bool page_pool_recycle_in_cache(netmem_ref netmem,
> return false;
> }
>
> +#ifdef CONFIG_DEBUG_PAGE_POOL_CACHE_RELEASE
> + if (unlikely(!page_pool_napi_local(pool))) {
if you do IS_ENABLED(CONFIG_DEBUG_PAGE_POOL_CACHE_RELEASE) you could
avoid the ifdef.
A quick question, where is this allow_direct argument supposed to come
from? I just noticed that mlx5 does
page_pool_put_unrefed_netmem(, true);
which then does not consider page_pool_napi_local(). But your proposed
change here will complain as it should.
> + u32 pp_cpuid = READ_ONCE(pool->cpuid);
> + u32 cpuid = smp_processor_id();
> +
> + WARN_RATELIMIT(1, "page_pool %d: direct page release from wrong CPU %d, expected CPU %d",
> + pool->user.id, cpuid, pp_cpuid);
> +
> + return false;
> + }
> +#endif
> +
> /* Caller MUST have verified/know (page_ref_count(page) == 1) */
> pool->alloc.cache[pool->alloc.count++] = netmem;
> recycle_stat_inc(pool, cached);
Sebastian
Powered by blists - more mailing lists