From: dayou5941@163.com
To: linux-block@vger.kernel.org
Cc: yukuai@fnnas.com, axboe@kernel.dk, liyouhong@kylinos.cn
Subject: [PATCH] block, bfq: skip dispatch when selected queue has no next_rq
Date: Wed, 20 May 2026 17:50:24 +0800 [thread overview]
Message-ID: <20260520095024.685338-1-dayou5941@163.com> (raw)
From: liyouhong <liyouhong@kylinos.cn>
bfq_dispatch_rq_from_bfqq() dispatches bfqq->next_rq directly. Add a
guard in __bfq_dispatch_request() so that dispatch is skipped if the
selected queue unexpectedly has no next request.
This keeps behavior unchanged in normal paths while avoiding entering
the dispatch helper with a missing next_rq.
Signed-off-by: liyouhong <liyouhong@kylinos.cn>
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 141c602d5e85..c3d9d02064b7 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -5226,7 +5226,7 @@ static struct request *__bfq_dispatch_request(struct blk_mq_hw_ctx *hctx)
goto exit;
bfqq = bfq_select_queue(bfqd);
- if (!bfqq)
+ if (!bfqq || !bfqq->next_rq)
goto exit;
rq = bfq_dispatch_rq_from_bfqq(bfqd, bfqq);
--
2.25.1
next reply other threads:[~2026-05-20 9:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 9:50 dayou5941 [this message]
2026-05-21 9:27 ` [PATCH] block, bfq: skip dispatch when selected queue has no next_rq Yu Kuai
2026-05-21 9:43 ` 李佑鸿
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260520095024.685338-1-dayou5941@163.com \
--to=dayou5941@163.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=liyouhong@kylinos.cn \
--cc=yukuai@fnnas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox