]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
io_uring/zcrx: warn on alloc with non-empty pp cache
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 23 Mar 2026 12:43:59 +0000 (12:43 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 Apr 2026 16:21:12 +0000 (10:21 -0600)
Page pool ensures the cache is empty before asking to refill it. Warn if
the assumption is violated.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://patch.msgid.link/9c9792d6e65f3780d57ff83b6334d341ed9a5f29.1774261953.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/zcrx.c

index a7790d609f40d018cd5b7c7d8d8dd88f2740cecf..eca30f8461ccfc528175096b44e079b04bd5ff59 100644 (file)
@@ -1075,8 +1075,8 @@ static netmem_ref io_pp_zc_alloc_netmems(struct page_pool *pp, gfp_t gfp)
        struct io_zcrx_ifq *ifq = io_pp_to_ifq(pp);
 
        /* pp should already be ensuring that */
-       if (unlikely(pp->alloc.count))
-               goto out_return;
+       if (WARN_ON_ONCE(pp->alloc.count))
+               return 0;
 
        io_zcrx_ring_refill(pp, ifq);
        if (likely(pp->alloc.count))