]> git.ipfire.org Git - thirdparty/linux.git/commit
io_uring/zcrx: reverse ifq refcount
authorDavid Wei <dw@davidwei.uk>
Tue, 4 Nov 2025 22:44:58 +0000 (14:44 -0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 6 Nov 2025 23:23:21 +0000 (16:23 -0700)
commit75c299a917e4547dfe640ce7fd83c8a14d8409d0
tree1b2e6d6ef5ead0e3a877d2741a3b31f99724a3c1
parent1bd95163dae80b940ea4b7bfa0720d3cc538a68b
io_uring/zcrx: reverse ifq refcount

Add a refcount to struct io_zcrx_ifq to reverse the refcounting
relationship i.e. rings now reference ifqs instead. As a result of this,
remove ctx->refs that an ifq holds on a ring via the page pool memory
provider.

This ref ifq->refs is held by internal users of an ifq, namely rings and
the page pool memory provider associated with an ifq. This is needed to
keep the ifq around until the page pool is destroyed.

Since ifqs now no longer hold refs to ring ctx, there isn't a need to
split the cleanup of ifqs into two: io_shutdown_zcrx_ifqs() in
io_ring_exit_work() while waiting for ctx->refs to drop to 0, and
io_unregister_zcrx_ifqs() after. Remove io_shutdown_zcrx_ifqs().

Signed-off-by: David Wei <dw@davidwei.uk>
Co-developed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/zcrx.c
io_uring/zcrx.h