io_uring: remove extra check in __io_commit_cqring
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 17 Jan 2020 00:52:46 +0000 (03:52 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 21 Jan 2020 00:04:06 +0000 (17:04 -0700)
__io_commit_cqring() is almost always called when there is a change in
the rings, so the check is rather pessimising.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index 68843a12300030c5e2101e29ac25ce4b39f28229..771954bb4c38a291f75c51fb27a3196e3481a895 100644 (file)
@@ -860,14 +860,12 @@ static void __io_commit_cqring(struct io_ring_ctx *ctx)
 {
        struct io_rings *rings = ctx->rings;
 
-       if (ctx->cached_cq_tail != READ_ONCE(rings->cq.tail)) {
-               /* order cqe stores with ring update */
-               smp_store_release(&rings->cq.tail, ctx->cached_cq_tail);
+       /* order cqe stores with ring update */
+       smp_store_release(&rings->cq.tail, ctx->cached_cq_tail);
 
-               if (wq_has_sleeper(&ctx->cq_wait)) {
-                       wake_up_interruptible(&ctx->cq_wait);
-                       kill_fasync(&ctx->cq_fasync, SIGIO, POLL_IN);
-               }
+       if (wq_has_sleeper(&ctx->cq_wait)) {
+               wake_up_interruptible(&ctx->cq_wait);
+               kill_fasync(&ctx->cq_fasync, SIGIO, POLL_IN);
        }
 }