Thread (9 messages) 9 messages, 1 author, 2021-03-08
DORMANTno replies
Revisions (3)
  1. rfc current
  2. v2 [diff vs current]
  3. v3 [diff vs current]

[RFC PATCH 2/8] bfq: limit the IO depth of idle_class to 1

From: brookxu <hidden>
Date: 2021-03-08 12:01:22
Also in: linux-block, lkml
Subsystem: bfq i/o scheduler, block layer, the rest · Maintainers: Yu Kuai, Jens Axboe, Linus Torvalds

From: Chunguang Xu <redacted>

From: Chunguang Xu <redacted>

The IO depth of idle_class is limited to 1, so that it can
avoid introducing a larger tail latency under a device with
a larger IO depth. Although limiting the IO depth may reduce
the performance of idle_class, it is generally not a big
problem, because idle_class usually does not have strict
performance requirements.

Signed-off-by: Chunguang Xu <redacted>
---
 block/bfq-iosched.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index ec482e6641ff..ea9d7f6f4e3d 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -4808,6 +4808,17 @@ static struct request *__bfq_dispatch_request(struct blk_mq_hw_ctx *hctx)
 	if (!bfqq)
 		goto exit;
 
+	/*
+	 * Here, the IO depth of idle_class is limited to 1, so that it
+	 * can avoid introducing a larger tail latency under a device
+	 * with a larger IO depth. Although limiting the IO depth may
+	 * reduce the performance of idle_class, it is generally not a
+	 * big problem, because idle_class usually does not have strict
+	 * performance requirements.
+	 */
+	if (bfq_class_idle(bfqq) && bfqq->dispatched)
+		goto exit;
+
 	rq = bfq_dispatch_rq_from_bfqq(bfqd, bfqq);
 
 	if (rq) {
-- 
2.30.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help