Skip to content

Commit 0ec6dca

Browse files
isilenceaxboe
authored andcommitted
io_uring: use state completion infra for poll reqs
Use io_req_task_complete() for poll request completions, so it can utilise state completions and save lots of unnecessary locking. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/ced94cb5a728d8e386c640d052fd3da3f5d6891a.1655371007.git.asml.silence@gmail.com Reviewed-by: Hao Xu <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 8b1dfd3 commit 0ec6dca

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

io_uring/poll.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,8 @@ static void io_poll_task_func(struct io_kiocb *req, bool *locked)
234234

235235
io_poll_remove_entries(req);
236236
io_poll_req_delete(req, ctx);
237-
spin_lock(&ctx->completion_lock);
238-
req->cqe.flags = 0;
239-
__io_req_complete_post(req);
240-
io_commit_cqring(ctx);
241-
spin_unlock(&ctx->completion_lock);
242-
io_cqring_ev_posted(ctx);
237+
io_req_set_res(req, req->cqe.res, 0);
238+
io_req_task_complete(req, locked);
243239
}
244240

245241
static void io_apoll_task_func(struct io_kiocb *req, bool *locked)

0 commit comments

Comments
 (0)