io_uring: simplify io_has_work
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 5 Jan 2023 11:22:26 +0000 (11:22 +0000)
committerJens Axboe <axboe@kernel.dk>
Sun, 29 Jan 2023 22:17:40 +0000 (15:17 -0700)
->work_llist should never be non-empty for a non DEFER_TASKRUN ring, so
we can safely skip checking the flag.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/26af9f73c09a56c9a035f94db56127358688f3aa.1672916894.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c

index 2cbf33996c3b77f23f11fc3f1ea9260a0c7dc214..4cb9cce23c9084a366b139636363c6aa884acf9b 100644 (file)
@@ -2419,8 +2419,7 @@ struct io_wait_queue {
 static inline bool io_has_work(struct io_ring_ctx *ctx)
 {
        return test_bit(IO_CHECK_CQ_OVERFLOW_BIT, &ctx->check_cq) ||
-              ((ctx->flags & IORING_SETUP_DEFER_TASKRUN) &&
-               !llist_empty(&ctx->work_llist));
+              !llist_empty(&ctx->work_llist);
 }
 
 static inline bool io_should_wake(struct io_wait_queue *iowq)