]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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>
Tue, 29 Oct 2024 19:43:27 +0000 (13:43 -0600)
commit085268829b07202cf7bf8ec1a8fb7fd9d8f6a41a
treefb19fea81f3358e6c6a8c34823ad6f6a401d4a29
parent829ab73e7bca455e1a8718325177cfb98b63d0df
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