All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: BFQ default for single queue devices
@ 2018-10-02 12:43 ` Linus Walleij
  0 siblings, 0 replies; 104+ messages in thread
From: Linus Walleij @ 2018-10-02 12:43 UTC (permalink / raw)
  To: linux-block, Jens Axboe
  Cc: linux-mmc, linux-mtd, Linus Walleij, Pavel Machek, Paolo Valente,
	Ulf Hansson, Richard Weinberger, Artem Bityutskiy, Adrian Hunter

This sets BFQ as the default scheduler for single queue
block devices (nr_hw_queues == 1) if it is available. This
affects notably MMC/SD-cards but notably also UBI and
the loopback device.

I have been running it for a while without any negative
effects on my pet systems and I want some wider testing
so let's throw it out there and see what people say.
Admittedly my use cases are limited.

I talked to Pavel a bit back and it turns out he has a
usecase for BFQ as well and I bet he also would like it
as default scheduler for that system (Pavel tell us more,
I don't remember what it was!)

Intuitively I could understand that maybe we want to
leave the loop device (possibly others? nbd? rbd?) as
"none", as it is probably relying on a scheduler on the
device below it, so I'm open to passing in a scheduler hint
from the respective subsystem in say struct blk_mq_tag_set.
However that makes for a bit of syntactic dissonance
with the struct member ".nr_hw_queues" (I wonder how
the loop device can have 1 "hardware queue"?) so
maybe we should in that case also rename that struct
member to ".nr_queues" fair and square before we start
making adjustments for treating queues differently whether
they are in hardware or actually not.

Cc: Pavel Machek <pavel@ucw.cz>
Cc: Paolo Valente <paolo.valente@linaro.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 block/elevator.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index e18ac68626e3..e5a2c39eee7b 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -948,13 +948,15 @@ int elevator_switch_mq(struct request_queue *q,
 }
 
 /*
- * For blk-mq devices, we default to using mq-deadline, if available, for single
- * queue devices.  If deadline isn't available OR we have multiple queues,
- * default to "none".
+ * For blk-mq devices, we default to using:
+ * - "none" for multiqueue devices (nr_hw_queues != 1)
+ * - "bfq", if available, for single queue devices
+ * - "mq-deadline" if "bfq" is not available for single queue devices
+ * - "none" for single queue devices as well as last resort
  */
 int elevator_init_mq(struct request_queue *q)
 {
-	struct elevator_type *e;
+	struct elevator_type *e = NULL;
 	int err = 0;
 
 	if (q->nr_hw_queues != 1)
@@ -968,9 +970,14 @@ int elevator_init_mq(struct request_queue *q)
 	if (unlikely(q->elevator))
 		goto out_unlock;
 
-	e = elevator_get(q, "mq-deadline", false);
-	if (!e)
-		goto out_unlock;
+	if (IS_ENABLED(CONFIG_IOSCHED_BFQ))
+		e = elevator_get(q, "bfq", false);
+
+	if (!e) {
+		e = elevator_get(q, "mq-deadline", false);
+		if (!e)
+			goto out_unlock;
+	}
 
 	err = blk_mq_init_sched(q, e);
 	if (err)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 104+ messages in thread

end of thread, other threads:[~2018-10-06 16:46 UTC | newest]

Thread overview: 104+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 12:43 [PATCH] block: BFQ default for single queue devices Linus Walleij
2018-10-02 12:43 ` Linus Walleij
2018-10-02 14:31 ` Jens Axboe
2018-10-02 14:31   ` Jens Axboe
2018-10-02 14:45   ` Linus Walleij
2018-10-02 14:45     ` Linus Walleij
2018-10-03  6:29   ` Paolo Valente
2018-10-03  6:29     ` Paolo Valente
2018-10-03  6:29     ` Paolo Valente
2018-10-03  6:53     ` Linus Walleij
2018-10-03 13:25       ` Jan Kara
2018-10-04  7:45         ` Johannes Thumshirn
2018-10-04  7:45           ` Johannes Thumshirn
2018-10-04  8:24           ` Andreas Herrmann
2018-10-03  7:05     ` Artem Bityutskiy
2018-10-03  7:05       ` Artem Bityutskiy
2018-10-03  7:05       ` Artem Bityutskiy
2018-10-03  7:18       ` Linus Walleij
2018-10-03  7:42         ` Damien Le Moal
2018-10-03  7:42           ` Damien Le Moal
2018-10-03  8:28           ` Linus Walleij
2018-10-03  8:53             ` Damien Le Moal
2018-10-03  8:53               ` Damien Le Moal
2018-10-03  8:53               ` Damien Le Moal
2018-10-03 15:53             ` Paolo Valente
2018-10-03 15:53               ` Paolo Valente
2018-10-03 17:34               ` Bryan Gurney
2018-10-04  8:21                 ` Linus Walleij
2018-10-04  9:56                 ` Ulf Hansson
2018-10-03 12:51           ` Christoph Hellwig
2018-10-03 12:51             ` Christoph Hellwig
2018-10-03 14:58             ` Bart Van Assche
2018-10-03 14:58               ` Bart Van Assche
2018-10-03 15:01               ` Christoph Hellwig
2018-10-03 15:01                 ` Christoph Hellwig
2018-10-03 15:15                 ` Bart Van Assche
2018-10-03 15:15                   ` Bart Van Assche
2018-10-03 15:15                   ` Bart Van Assche
2018-10-05  6:24                   ` Christoph Hellwig
2018-10-05  6:24                     ` Christoph Hellwig
2018-10-03 15:52           ` Paolo Valente
2018-10-03 15:52             ` Paolo Valente
2018-10-03 15:52             ` Paolo Valente
2018-10-03 11:49     ` Oleksandr Natalenko
2018-10-03 11:49       ` Oleksandr Natalenko
2018-10-03 11:49       ` Oleksandr Natalenko
2018-10-03 14:51       ` Mark Brown
2018-10-03 14:51         ` Mark Brown
2018-10-03 15:55       ` Paolo Valente
2018-10-03 15:55         ` Paolo Valente
2018-10-03 15:55         ` Paolo Valente
2018-10-03 16:00         ` Bart Van Assche
2018-10-03 16:00           ` Bart Van Assche
2018-10-03 16:00           ` Bart Van Assche
2018-10-03 16:04           ` Paolo Valente
2018-10-03 16:04             ` Paolo Valente
2018-10-03 16:04             ` Paolo Valente
2018-10-04  7:38         ` Jan Kara
2018-10-04  7:38           ` Jan Kara
2018-10-04  8:14       ` Linus Walleij
2018-10-04 10:13         ` Mark Brown
2018-10-04 15:10           ` Bart Van Assche
2018-10-04 15:10             ` Bart Van Assche
2018-10-04 15:26             ` Mark Brown
2018-10-05  9:49         ` Pavel Machek
2018-10-04  8:25       ` Linus Walleij
2018-10-03 15:54     ` Bart Van Assche
2018-10-03 15:54       ` Bart Van Assche
2018-10-03 15:54       ` Bart Van Assche
2018-10-03 16:02       ` Paolo Valente
2018-10-03 16:02         ` Paolo Valente
2018-10-03 16:02         ` Paolo Valente
2018-10-03 16:09         ` Paolo Valente
2018-10-03 17:22         ` Paolo Valente
2018-10-03 17:22           ` Paolo Valente
2018-10-04 19:25       ` Alan Cox
2018-10-04 19:25         ` Alan Cox
2018-10-04 20:09         ` Bart Van Assche
2018-10-04 20:39           ` Paolo Valente
2018-10-04 20:39             ` Paolo Valente
2018-10-04 22:42             ` Bart Van Assche
2018-10-05  9:16               ` Jan Kara
2018-10-06  3:12                 ` Bart Van Assche
2018-10-06  6:46                   ` Paolo Valente
2018-10-06  6:46                     ` Paolo Valente
2018-10-06  6:46                     ` Paolo Valente
2018-10-06 16:20                     ` Bart Van Assche
2018-10-06 16:20                       ` Bart Van Assche
2018-10-06 16:46                       ` Paolo Valente
2018-10-06 16:46                         ` Paolo Valente
2018-10-06 16:46                         ` Paolo Valente
2018-10-05  9:28               ` Paolo Valente
2018-10-05  9:28                 ` Paolo Valente
2018-10-05  6:24           ` Artem Bityutskiy
2018-10-05  6:24             ` Artem Bityutskiy
2018-10-04 20:19         ` Paolo Valente
2018-10-04 20:19           ` Paolo Valente
2018-10-02 21:28 ` Richard Weinberger
2018-10-02 21:28   ` Richard Weinberger
2018-10-03 15:51 ` Paolo Valente
2018-10-03 15:51   ` Paolo Valente
2018-10-03 15:51   ` Paolo Valente
2018-10-05  8:04 ` Pavel Machek
2018-10-05  8:04   ` Pavel Machek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.