Skip to content

Commit b5ce818

Browse files
Ming Leigregkh
authored andcommitted
blk-mq: insert request not through ->queue_rq into sw/scheduler queue
[ Upstream commit db03f88 ] c616cbe ("blk-mq: punt failed direct issue to dispatch list") supposed to add request which has been through ->queue_rq() to the hw queue dispatch list, however it adds request running out of budget or driver tag to hw queue too. This way basically bypasses request merge, and causes too many request dispatched to LLD, and system% is unnecessary increased. Fixes this issue by adding request not through ->queue_rq into sw/scheduler queue, and this way is safe because no ->queue_rq is called on this request yet. High %system can be observed on Azure storvsc device, and even soft lock is observed. This patch reduces %system during heavy sequential IO, meantime decreases soft lockup risk. Fixes: c616cbe ("blk-mq: punt failed direct issue to dispatch list") Signed-off-by: Ming Lei <ming.lei@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Bart Van Assche <bvanassche@acm.org> Cc: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3cea382 commit b5ce818

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎block/blk-mq.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,8 @@ static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
19091909
if (bypass_insert)
19101910
return BLK_STS_RESOURCE;
19111911

1912-
blk_mq_request_bypass_insert(rq, false, run_queue);
1912+
blk_mq_sched_insert_request(rq, false, run_queue, false);
1913+
19131914
return BLK_STS_OK;
19141915
}
19151916

0 commit comments

Comments
 (0)