Linux block layer
 help / color / mirror / Atom feed
* [PATCH] block, bfq: skip dispatch when selected queue has no next_rq
@ 2026-05-20  9:50 dayou5941
  2026-05-21  9:27 ` Yu Kuai
  0 siblings, 1 reply; 3+ messages in thread
From: dayou5941 @ 2026-05-20  9:50 UTC (permalink / raw)
  To: linux-block; +Cc: yukuai, axboe, liyouhong

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-21  9:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20  9:50 [PATCH] block, bfq: skip dispatch when selected queue has no next_rq dayou5941
2026-05-21  9:27 ` Yu Kuai
2026-05-21  9:43   ` 李佑鸿 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox