]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
io_uring: use lockless_cq flag in io_req_complete_post()
authorCaleb Sander Mateos <csander@purestorage.com>
Wed, 12 Feb 2025 00:51:18 +0000 (17:51 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 18 Feb 2025 17:32:22 +0000 (10:32 -0700)
io_uring_create() computes ctx->lockless_cq as:
ctx->task_complete || (ctx->flags & IORING_SETUP_IOPOLL)

So use it to simplify that expression in io_req_complete_post().

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20250212005119.3433005-1-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c

index b688953d1de8e52d3a44d6f63bd06034956ec0d1..bd1ab21ed5393f317a380c85ebb3dba9632ef42c 100644 (file)
@@ -900,7 +900,7 @@ static void io_req_complete_post(struct io_kiocb *req, unsigned issue_flags)
         * Handle special CQ sync cases via task_work. DEFER_TASKRUN requires
         * the submitter task context, IOPOLL protects with uring_lock.
         */
-       if (ctx->task_complete || (ctx->flags & IORING_SETUP_IOPOLL)) {
+       if (ctx->lockless_cq) {
                req->io_task_work.func = io_req_task_complete;
                io_req_task_work_add(req);
                return;