Skip to contentSkip to conversation

bfq/mq-deadline: remove redundant check for passthrough request

RFC PATCH Applied Lin Feng 3 participants 3 messages Apr 15, 2021 – Apr 16, 2021

Subsystems (2)
lore
Share & tools
lore

Lin Feng

author
#0 lore raw

RFC PATCH 2/2 bfq/mq-deadline: remove redundant check for passthrough request

Since commit 01e99aeca39796003 'blk-mq: insert passthrough request into hctx->dispatch directly', passthrough request should not appear in IO-scheduler any more, so blk_rq_is_passthrough checking in addon IO schedulers is redundant.

(Notes: this patch passes generic IO load test with hdds under SAS controller and hdds under AHCI controller but obviously not covers all. Not sure if passthrough request can still escape into IO scheduler from blk_mq_sched_insert_requests, which is used by blk_mq_flush_plug_list and has lots of indirect callers.)

---
 block/bfq-iosched.c | 2 +-
 block/mq-deadline.c | 7 ++-----
 2 files changed, 3 insertions(+), 6 deletions(-)
block/bfq-iosched.c +1 -1
index 95586137194e..b827c9212b02 100644
@@ -5627,7 +5627,7 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
 
 	spin_lock_irq(&bfqd->lock);
 	bfqq = bfq_init_rq(rq);
-	if (!bfqq || at_head || blk_rq_is_passthrough(rq)) {
+	if (!bfqq || at_head) {
 		if (at_head)
 			list_add(&rq->queuelist, &bfqd->dispatch);
 		else
block/mq-deadline.c +2 -5
index f3631a287466..04aded71ead2 100644
@@ -500,11 +500,8 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
 
 	trace_block_rq_insert(rq);
 
-	if (at_head || blk_rq_is_passthrough(rq)) {
-		if (at_head)
-			list_add(&rq->queuelist, &dd->dispatch);
-		else
-			list_add_tail(&rq->queuelist, &dd->dispatch);
+	if (at_head) {
+		list_add(&rq->queuelist, &dd->dispatch);
 	} else {
 		deadline_add_rq_rb(dd, rq);
 
Signature · 1 line
2.30.2
Reviewed-by on v1 2/2
#1 lore raw
Quoted 51 lines · Lin Feng

Since commit 01e99aeca39796003 'blk-mq: insert passthrough request into hctx->dispatch directly', passthrough request should not appear in IO-scheduler any more, so blk_rq_is_passthrough checking in addon IO schedulers is redundant.

(Notes: this patch passes generic IO load test with hdds under SAS controller and hdds under AHCI controller but obviously not covers all. Not sure if passthrough request can still escape into IO scheduler from blk_mq_sched_insert_requests, which is used by blk_mq_flush_plug_list and has lots of indirect callers.)

---
 block/bfq-iosched.c | 2 +-
 block/mq-deadline.c | 7 ++-----
 2 files changed, 3 insertions(+), 6 deletions(-)
block/bfq-iosched.c +1 -1
index 95586137194e..b827c9212b02 100644
@@ -5627,7 +5627,7 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
 
 	spin_lock_irq(&bfqd->lock);
 	bfqq = bfq_init_rq(rq);
-	if (!bfqq || at_head || blk_rq_is_passthrough(rq)) {
+	if (!bfqq || at_head) {
 		if (at_head)
 			list_add(&rq->queuelist, &bfqd->dispatch);
 		else
block/mq-deadline.c +2 -5
index f3631a287466..04aded71ead2 100644
@@ -500,11 +500,8 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
 
 	trace_block_rq_insert(rq);
 
-	if (at_head || blk_rq_is_passthrough(rq)) {
-		if (at_head)
-			list_add(&rq->queuelist, &dd->dispatch);
-		else
-			list_add_tail(&rq->queuelist, &dd->dispatch);
+	if (at_head) {
+		list_add(&rq->queuelist, &dd->dispatch);
 	} else {
 		deadline_add_rq_rb(dd, rq);
 
Signature · 1 line
2.30.2

Looks fine:

Thanks,
Ming

maintainer Applied
#2 lore raw
In reply to Lin Feng
Quoted 10 lines · Lin Feng

Since commit 01e99aeca39796003 'blk-mq: insert passthrough request into hctx->dispatch directly', passthrough request should not appear in IO-scheduler any more, so blk_rq_is_passthrough checking in addon IO schedulers is redundant.

(Notes: this patch passes generic IO load test with hdds under SAS controller and hdds under AHCI controller but obviously not covers all. Not sure if passthrough request can still escape into IO scheduler from blk_mq_sched_insert_requests, which is used by blk_mq_flush_plug_list and has lots of indirect callers.)

Applied, with the bfq bits hand edited to apply for 5.13.

Signature · 1 line
Jens Axboe