io_uring: move to using private ring references
authorJens Axboe <axboe@kernel.dk>
Sat, 8 Jul 2023 15:46:56 +0000 (09:46 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Jun 2024 17:15:10 +0000 (11:15 -0600)
commit9fa73fd8ff4263dde2c6d9a50c93cd9cb40bad91
tree1a0b5ea21e096079238ce63f8a7c5058bcf278f0
parentb7fe5dfeb44fad432c6d8b8890f7ab8501e4a3a3
io_uring: move to using private ring references

io_uring currently uses percpu refcounts for the ring reference. This
works fine, but exiting a ring requires an RCU grace period to lapse
and this slows down ring exit quite a lot.

Add a basic per-cpu counter for our references instead, and use that.
This is in preparation for doing a sync wait on on any request (notably
file) references on ring exit. As we're going to be waiting on ctx refs
going away as well with that, the RCU grace period wait becomes a
noticeable slowdown.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/Makefile
io_uring/io_uring.c
io_uring/refs.c [new file with mode: 0644]
io_uring/refs.h
io_uring/register.c
io_uring/rw.c
io_uring/sqpoll.c