On Sat, 20 Sep 2025 09:25:31 +0000 Dragos Tatulea wrote:
quoted
The patch seems half-baked. If the NAPI local recycling is incorrect
the pp will leak a reference and live forever. Which hopefully people
would notice. Are you adding this check just to double confirm that
any leaks you're chasing are in the driver, and not in the core?
The point is not to chase leaks but races from doing a recycle to cache
from the wrong CPU. This is how XDP issue was caught where
xdp_set_return_frame_no_direct() was not set appropriately for cpumap [1].
My first approach was to __page_pool_put_page() but then I figured that
the warning should live closer to where the actual assignment happens.
[1] https://lore.kernel.org/all/e60404e2-4782-409f-8596-ae21ce7272c4@kernel.org/ (local)
Ah, that thing. I wonder whether the complexity in the driver-facing
xdp_return API is really worth the gain here. IIUC we want to extract
the cases where we're doing local recycling and let those cases use
the lockless cache. But all those cases should be caught by automatic
local recycling detection, so caller can just pass false..