io_uring/poll: get rid of unlocked cancel hash
authorJens Axboe <axboe@kernel.dk>
Mon, 30 Sep 2024 20:22:36 +0000 (14:22 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 14 Oct 2024 15:04:10 +0000 (09:04 -0600)
commit51a69924377e679f1437cc78146a1bff5c4cc936
treeceb58345cc381d28d1a0b9bce66cb0923cdb6768
parent6daa792e930162ece9f40815190ebb814a195f8c
io_uring/poll: get rid of unlocked cancel hash

io_uring maintains two hash lists of inflight requests:

1) ctx->cancel_table_locked. This is used when the caller has the
   ctx->uring_lock held already. This is only an issue side parameter,
   as removal or task_work will always have it held.

2) ctx->cancel_table. This is used when the issuer does NOT have the
   ctx->uring_lock held, and relies on the table spinlocks for access.

However, it's pretty trivial to simply grab the lock in the one spot
where we care about it, for insertion. With that, we can kill the
unlocked table (and get rid of the _locked postfix for the other one).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/fdinfo.c
io_uring/io_uring.c
io_uring/poll.c