mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 04:02:20 +00:00
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>
This commit is contained in:
parent
8b1dfd343a
commit
0ec6dca223
@ -234,12 +234,8 @@ static void io_poll_task_func(struct io_kiocb *req, bool *locked)
|
|||||||
|
|
||||||
io_poll_remove_entries(req);
|
io_poll_remove_entries(req);
|
||||||
io_poll_req_delete(req, ctx);
|
io_poll_req_delete(req, ctx);
|
||||||
spin_lock(&ctx->completion_lock);
|
io_req_set_res(req, req->cqe.res, 0);
|
||||||
req->cqe.flags = 0;
|
io_req_task_complete(req, locked);
|
||||||
__io_req_complete_post(req);
|
|
||||||
io_commit_cqring(ctx);
|
|
||||||
spin_unlock(&ctx->completion_lock);
|
|
||||||
io_cqring_ev_posted(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void io_apoll_task_func(struct io_kiocb *req, bool *locked)
|
static void io_apoll_task_func(struct io_kiocb *req, bool *locked)
|
||||||
|
Loading…
Reference in New Issue
Block a user