Skip to content

Commit 62aa980

Browse files
calebsanderaxboe
authored andcommitted
io_uring: use lockless_cq flag in io_req_complete_post()
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>
1 parent 94a4274 commit 62aa980

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

io_uring/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ static void io_req_complete_post(struct io_kiocb *req, unsigned issue_flags)
900900
* Handle special CQ sync cases via task_work. DEFER_TASKRUN requires
901901
* the submitter task context, IOPOLL protects with uring_lock.
902902
*/
903-
if (ctx->task_complete || (ctx->flags & IORING_SETUP_IOPOLL)) {
903+
if (ctx->lockless_cq) {
904904
req->io_task_work.func = io_req_task_complete;
905905
io_req_task_work_add(req);
906906
return;

0 commit comments

Comments
 (0)