summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2026-03-23 15:43:59 +0300
committerJens Axboe <axboe@kernel.dk>2026-04-01 19:21:12 +0300
commit48f253d65d39a45d2eed395bf6b8ac3bb8b1e992 (patch)
tree04e2085a28a35c9e5a6cd5b1dc7081e700ce4ef3
parent7df542a6657534694779948195cc4d36ace575b5 (diff)
downloadlinux-48f253d65d39a45d2eed395bf6b8ac3bb8b1e992.tar.xz
io_uring/zcrx: warn on alloc with non-empty pp cache
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>
-rw-r--r--io_uring/zcrx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index a7790d609f40..eca30f8461cc 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -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))