summaryrefslogtreecommitdiffstats
path: root/io_uring/rw.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-11-23 11:33:42 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-31 13:33:12 +0100
commit69c2ad94fd0b5217a28ce20bba84f2063d383e94 (patch)
tree7d6f9f45c90687642c97450baf860c0e9ee0f689 /io_uring/rw.c
parent9b5d3f21f1aba54064f8f56694d09ee8d91daec3 (diff)
downloadlinux-stable-69c2ad94fd0b5217a28ce20bba84f2063d383e94.tar.gz
linux-stable-69c2ad94fd0b5217a28ce20bba84f2063d383e94.tar.bz2
linux-stable-69c2ad94fd0b5217a28ce20bba84f2063d383e94.zip
io_uring: remove iopoll spinlock
commit 2dac1a159216b39ced8d78dba590c5d2f4249586 upstream. This reverts commit 2ccc92f4effcfa1c51c4fcf1e34d769099d3cad4 io_req_complete_post() should now behave well even in case of IOPOLL, we can remove completion_lock locking. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/7e171c8b530656b14a671c59100ca260e46e7f2a.1669203009.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring/rw.c')
-rw-r--r--io_uring/rw.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/io_uring/rw.c b/io_uring/rw.c
index 98dfd8fdc9dc..bb47cc4da713 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -1043,7 +1043,6 @@ int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin)
else if (!pos)
return 0;
- spin_lock(&ctx->completion_lock);
prev = start;
wq_list_for_each_resume(pos, prev) {
struct io_kiocb *req = container_of(pos, struct io_kiocb, comp_list);
@@ -1058,11 +1057,11 @@ int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin)
req->cqe.flags = io_put_kbuf(req, 0);
__io_fill_cqe_req(req->ctx, req);
}
- io_commit_cqring(ctx);
- spin_unlock(&ctx->completion_lock);
+
if (unlikely(!nr_events))
return 0;
+ io_commit_cqring(ctx);
io_cqring_ev_posted_iopoll(ctx);
pos = start ? start->next : ctx->iopoll_list.first;
wq_list_cut(&ctx->iopoll_list, prev, start);