Skip to content

Commit

Permalink
io_uring: remove extra barrier for non-sqpoll iopoll
Browse files Browse the repository at this point in the history
smp_mb() in io_cqring_ev_posted_iopoll() is only there because of
waitqueue_active(). However, non-SQPOLL IOPOLL ring doesn't wake the CQ
and so the barrier there is useless. Kill it, it's usually pretty
expensive.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d72e8ef6f7a3f6a72e18fad8409f7d47afc8da7d.1647481208.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Mar 17, 2022
1 parent b91ef18 commit 0f84747
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,11 +1877,8 @@ static void io_cqring_ev_posted(struct io_ring_ctx *ctx)

static void io_cqring_ev_posted_iopoll(struct io_ring_ctx *ctx)
{
/* see waitqueue_active() comment */
smp_mb();

if (ctx->flags & IORING_SETUP_SQPOLL) {
if (waitqueue_active(&ctx->cq_wait))
if (wq_has_sleeper(&ctx->cq_wait))
wake_up_all(&ctx->cq_wait);
}
io_eventfd_signal(ctx);
Expand Down

0 comments on commit 0f84747

Please sign in to comment.