diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-03-17 02:03:39 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-03-16 20:26:32 -0600 |
commit | 0f84747177b962c32243a57cb454193bdba4fe8d (patch) | |
tree | 2590b62771b8ce15c8b31cce78f59d68f5f98e55 /fs | |
parent | b91ef1872869d99cd42e908eb9754b81115c2c05 (diff) | |
download | linux-0f84747177b962c32243a57cb454193bdba4fe8d.tar.bz2 |
io_uring: remove extra barrier for non-sqpoll iopoll
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/io_uring.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index f039706bce0e..692dbe7b98e9 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -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); |