blk-mq: improve scheduler queue sync/async running

This change “blk-mq: improve scheduler queue sync/async running” (commit 0abad77) in Linux kernel is authored by Jens Axboe <axboe [at] fb.com> on Thu Jan 26 12:28:10 2017 -0700.

Description of "blk-mq: improve scheduler queue sync/async running"

The change “blk-mq: improve scheduler queue sync/async running” introduces changes as follows.

blk-mq: improve scheduler queue sync/async running

We'll use the same criteria for whether we need to run the queue sync
or async when we have a scheduler, as we do without one.

Signed-off-by: Jens Axboe <axboe@fb.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Tested-by: Hannes Reinecke <hare@suse.com>

Linux kernel releases containing commit 0abad77

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "blk-mq: improve scheduler queue sync/async running"

There are 6 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 block/blk-mq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
 
diff --git a/block/blk-mq.c b/block/blk-mq.c
index ede835c2b08b..1f948d5c2715 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1476,7 +1476,8 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
 	if (q->elevator) {
 		blk_mq_put_ctx(data.ctx);
 		blk_mq_bio_to_request(rq, bio);
-		blk_mq_sched_insert_request(rq, false, true, true);
+		blk_mq_sched_insert_request(rq, false, true,
+						!is_sync || is_flush_fua);
 		goto done;
 	}
 	if (!blk_mq_merge_queue_io(data.hctx, data.ctx, rq, bio)) {
@@ -1585,7 +1586,8 @@ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio)
 	if (q->elevator) {
 		blk_mq_put_ctx(data.ctx);
 		blk_mq_bio_to_request(rq, bio);
-		blk_mq_sched_insert_request(rq, false, true, true);
+		blk_mq_sched_insert_request(rq, false, true,
+						!is_sync || is_flush_fua);
 		goto done;
 	}
 	if (!blk_mq_merge_queue_io(data.hctx, data.ctx, rq, bio)) {

The commit for this change in Linux stable tree is 0abad77 (patch).

Last modified: 2020/02/09