Skip to contentSkip to conversation

blk-mq: don't issue request directly in case that current is to be blocked

PATCH Applied Ming Lei 2 participants 3 messages Oct 26, 2021 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 blk-mq: don't issue request directly in case that current is to be blocked

When flushing plug list in case that current will be blocked, we can't issue request directly because ->queue_rq() may sleep, otherwise scheduler may complain.

Fixes dc5fc361d891 ("block: attempt direct issue of plug list")
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-mq.c +1 -1
index c19dfa8ea65e..9840b15f505b 100644
@@ -2223,7 +2223,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
 		return;
 	plug->rq_count = 0;
 
-	if (!plug->multiple_queues && !plug->has_elevator) {
+	if (!plug->multiple_queues && !plug->has_elevator && !from_schedule) {
 		blk_mq_plug_issue_direct(plug, from_schedule);
 		if (rq_list_empty(plug->mq_list))
 			return;
Signature · 1 line
2.31.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Ming Lei

When flushing plug list in case that current will be blocked, we can't issue request directly because ->queue_rq() may sleep, otherwise scheduler may complain.

Applied, thanks!

[1/1] blk-mq: don't issue request directly in case that current is to be blocked

      commit: ff1552232b3612edff43a95746a4e78e231ef3d4

Best regards,

Signature · 1 line
Jens Axboe
maintainer
#2 lore raw
In reply to Ming Lei
Quoted 3 lines · Ming Lei

When flushing plug list in case that current will be blocked, we can't issue request directly because ->queue_rq() may sleep, otherwise scheduler may complain.

Oops indeed, thanks Ming.

Signature · 1 line
Jens Axboe