aboutsummaryrefslogtreecommitdiff
path: root/io_uring/poll.c
diff options
context:
space:
mode:
authorPavel Begunkov2022-06-16 10:22:07 +0100
committerJens Axboe2022-07-24 18:39:13 -0600
commit0ec6dca223195aca2f7df6e432c4205b5f63305b (patch)
tree5bbcf70bd31c60b87a35e87392d5ab57170c814c /io_uring/poll.c
parent8b1dfd343ae6a64ca2b4741ab47a162fa59f43be (diff)
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 <asml.silence@gmail.com> Link: https://lore.kernel.org/r/ced94cb5a728d8e386c640d052fd3da3f5d6891a.1655371007.git.asml.silence@gmail.com Reviewed-by: Hao Xu <howeyxu@tencent.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/poll.c')
-rw-r--r--io_uring/poll.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/io_uring/poll.c b/io_uring/poll.c
index 5b2c6ce26a55..7f2ebb56f7db 100644
--- a/io_uring/poll.c
+++ b/io_uring/poll.c
@@ -234,12 +234,8 @@ static void io_poll_task_func(struct io_kiocb *req, bool *locked)
io_poll_remove_entries(req);
io_poll_req_delete(req, ctx);
- spin_lock(&ctx->completion_lock);
- req->cqe.flags = 0;
- __io_req_complete_post(req);
- io_commit_cqring(ctx);
- spin_unlock(&ctx->completion_lock);
- io_cqring_ev_posted(ctx);
+ io_req_set_res(req, req->cqe.res, 0);
+ io_req_task_complete(req, locked);
}
static void io_apoll_task_func(struct io_kiocb *req, bool *locked)