From: Pavel Begunkov Date: Sun, 16 May 2021 21:58:03 +0000 (+0100) Subject: io_uring: simplify waking sqo_sq_wait X-Git-Tag: accepted/tizen/unified/20230118.172025~6938^2~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acfb381d9d714c657ff540099fa5a6fa98e71f07;p=platform%2Fkernel%2Flinux-rpi.git io_uring: simplify waking sqo_sq_wait Going through submission in __io_sq_thread() and still having a full SQ is rather unexpected, so remove a check for SQ fullness and just wake up whoever wait on sqo_sq_wait. Also skip if it doesn't do submission in the first place, likely may to happen for SQPOLL sharing and/or IOPOLL. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/e2e91751e87b1a39f8d63ef884aaff578123f61e.1621201931.git.asml.silence@gmail.com Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index d18be5a..3a78899 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -6801,10 +6801,10 @@ static int __io_sq_thread(struct io_ring_ctx *ctx, bool cap_entries) !(ctx->flags & IORING_SETUP_R_DISABLED)) ret = io_submit_sqes(ctx, to_submit); mutex_unlock(&ctx->uring_lock); - } - if (!io_sqring_full(ctx) && wq_has_sleeper(&ctx->sqo_sq_wait)) - wake_up(&ctx->sqo_sq_wait); + if (to_submit && wq_has_sleeper(&ctx->sqo_sq_wait)) + wake_up(&ctx->sqo_sq_wait); + } return ret; }