io_uring: simplify IORING_SETUP_DEFER_TASKRUN && !SQPOLL check
PATCH 1/1 io_uring: simplify IORING_SETUP_DEFER_TASKRUN && !SQPOLL check
io_uring_sanitise_params() already rejects flags that include both IORING_SETUP_SQPOLL and IORING_SETUP_DEFER_TASKRUN. So it's unnecessary to check IORING_SETUP_SQPOLL in io_uring_create() when IORING_SETUP_DEFER_TASKRUN has already been checked. Drop the !(ctx->flags & IORING_SETUP_SQPOLL) check for the task_complete case.
--- io_uring/io_uring.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
io_uring/io_uring.c +1 -2
@@ -2901,12 +2901,11 @@ static __cold int io_uring_create(struct io_ctx_config *config)if (!(ctx->flags &IORING_SETUP_NO_SQARRAY ))static_branch_inc (&io_key_has_sqarray);if ((ctx->flags &IORING_SETUP_DEFER_TASKRUN ) && - !(ctx->flags &IORING_SETUP_IOPOLL ) && - !(ctx->flags &IORING_SETUP_SQPOLL )) + !(ctx->flags &IORING_SETUP_IOPOLL )) ctx->task_complete = true;if (ctx->task_complete || (ctx->flags &IORING_SETUP_IOPOLL )) ctx->lockless_cq = true;
Signature · 1 line
2.45.2
Quoted 8 lines · Caleb Sander Mateos
io_uring_sanitise_params()already rejects flags that include bothIORING_SETUP_SQPOLLandIORING_SETUP_DEFER_TASKRUN. So it's unnecessary to checkIORING_SETUP_SQPOLLinio_uring_create()whenIORING_SETUP_DEFER_TASKRUNhas already been checked. Drop the !(ctx->flags &IORING_SETUP_SQPOLL) check for thetask_completecase.[...]
Applied, thanks!
[1/1] io_uring: simplify IORING_SETUP_DEFER_TASKRUN && !SQPOLL check
commit: 7cb3a68376da0bc0afab8157223cb479c97de9ff
Best regards,
Signature · 1 line
Jens Axboe