diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-09-30 14:35:52 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-10-29 13:43:27 -0600 |
commit | 879ba46a38e67595b96c87428fbb718d63821da2 (patch) | |
tree | c522776a2f2f352d06be82346bb81a4c38af4c64 /io_uring | |
parent | 085268829b07202cf7bf8ec1a8fb7fd9d8f6a41a (diff) | |
download | lwn-879ba46a38e67595b96c87428fbb718d63821da2.tar.gz lwn-879ba46a38e67595b96c87428fbb718d63821da2.zip |
io_uring/poll: get rid of io_poll_tw_hash_eject()
It serves no purposes anymore, all it does is delete the hash list
entry. task_work always has the ring locked.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/poll.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/io_uring/poll.c b/io_uring/poll.c index 217d667e0622..a0d1a09c5a20 100644 --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -128,20 +128,6 @@ static void io_poll_req_insert(struct io_kiocb *req) hlist_add_head(&req->hash_node, &table->hbs[index].list); } -static void io_poll_tw_hash_eject(struct io_kiocb *req, struct io_tw_state *ts) -{ - struct io_ring_ctx *ctx = req->ctx; - - /* - * ->cancel_table_locked is protected by ->uring_lock in - * contrast to per bucket spinlocks. Likely, tctx_task_work() - * already grabbed the mutex for us, but there is a chance it - * failed. - */ - io_tw_lock(ctx, ts); - hash_del(&req->hash_node); -} - static void io_init_poll_iocb(struct io_poll *poll, __poll_t events) { poll->head = NULL; @@ -336,7 +322,8 @@ void io_poll_task_func(struct io_kiocb *req, struct io_tw_state *ts) return; } io_poll_remove_entries(req); - io_poll_tw_hash_eject(req, ts); + /* task_work always has ->uring_lock held */ + hash_del(&req->hash_node); if (req->opcode == IORING_OP_POLL_ADD) { if (ret == IOU_POLL_DONE) { |