Similarly to CFQ, BFQ has its write-throttling heuristics, and it
is better not to combine them with further write-throttling
heuristics of a different nature.
So this commit disables write-back throttling for a device if BFQ
is used as I/O scheduler for that device.
Signed-off-by: Luca Miccio <
lucm...@gmail.com>
Signed-off-by: Paolo Valente <
paolo....@linaro.org>
---
block/bfq-mq-iosched.c | 2 ++
block/bfq-sq-iosched.c | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/block/bfq-mq-iosched.c b/block/bfq-mq-iosched.c
index 8c5dce7716cb..f378519b6d33 100644
--- a/block/bfq-mq-iosched.c
+++ b/block/bfq-mq-iosched.c
@@ -89,6 +89,7 @@
#include "blk-mq-tag.h"
#include "blk-mq-sched.h"
#include "bfq-mq.h"
+#include "blk-wbt.h"
/* Expiration time of sync (0) and async (1) requests, in ns. */
static const u64 bfq_fifo_expire[2] = { NSEC_PER_SEC / 4, NSEC_PER_SEC / 8 };
@@ -5272,6 +5273,7 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)
bfq_init_root_group(bfqd->root_group, bfqd);
bfq_init_entity(&bfqd->oom_bfqq.entity, bfqd->root_group);
+ wbt_disable_default(q);
return 0;
out_free:
diff --git a/block/bfq-sq-iosched.c b/block/bfq-sq-iosched.c
index 5b456e48e0cc..f4654436cd55 100644
--- a/block/bfq-sq-iosched.c
+++ b/block/bfq-sq-iosched.c
@@ -83,6 +83,7 @@
#include <linux/ioprio.h>
#include "blk.h"
#include "bfq.h"
+#include "blk-wbt.h"
/* Expiration time of sync (0) and async (1) requests, in ns. */
static const u64 bfq_fifo_expire[2] = { NSEC_PER_SEC / 4, NSEC_PER_SEC / 8 };
@@ -4988,6 +4989,11 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)
return -ENOMEM;
}
+static void bfq_registered_queue(struct request_queue *q)
+{
+ wbt_disable_default(q);
+}
+
static void bfq_slab_kill(void)
{
kmem_cache_destroy(bfq_pool);
@@ -5297,6 +5303,7 @@ static struct elevator_type iosched_bfq = {
.elevator_may_queue_fn = bfq_may_queue,
.elevator_init_fn = bfq_init_queue,
.elevator_exit_fn = bfq_exit_queue,
+ .elevator_registered_fn = bfq_registered_queue,
},
.icq_size = sizeof(struct bfq_io_cq),
.icq_align = __alignof__(struct bfq_io_cq),
--
2.11.0