@@ -6812,6 +6812,7 @@ static struct elevator_type iosched_bfq_mq = {
.icq_align = __alignof__(struct bfq_io_cq),
.elevator_attrs = bfq_attrs,
.elevator_name = "bfq",
+ .elevator_features = ELEVATOR_F_SINGLE_HW_QUEUE,
.elevator_owner = THIS_MODULE,
};
MODULE_ALIAS("bfq-iosched");
@@ -678,6 +678,9 @@ void elevator_init_mq(struct request_queue *q)
if (unlikely(q->elevator))
return;
+ if (q->nr_hw_queues == 1)
+ q->required_elevator_features |= ELEVATOR_F_SINGLE_HW_QUEUE;
+
if (!q->required_elevator_features)
e = elevator_get_default(q);
else
@@ -794,7 +794,8 @@ static struct elevator_type mq_deadline = {
.elevator_attrs = deadline_attrs,
.elevator_name = "mq-deadline",
.elevator_alias = "deadline",
- .elevator_features = ELEVATOR_F_ZBD_SEQ_WRITE,
+ .elevator_features = ELEVATOR_F_ZBD_SEQ_WRITE |
+ ELEVATOR_F_SINGLE_HW_QUEUE,
.elevator_owner = THIS_MODULE,
};
MODULE_ALIAS("mq-deadline-iosched");
@@ -172,6 +172,8 @@ extern struct request *elv_rb_find(struct rb_root *, sector_t);
/* Supports zoned block devices sequential write constraint */
#define ELEVATOR_F_ZBD_SEQ_WRITE (1U << 0)
+/* Elevator is suitable for single hardware queue devices */
+#define ELEVATOR_F_SINGLE_HW_QUEUE (1U << 1)
#endif /* CONFIG_BLOCK */
#endif
The Kyber block scheduler is not suitable for single hardware queue devices, so add a new flag for single hardware queue devices and add that to the deadline and BFQ schedulers so the Kyber scheduler will not be selected for single queue devices. Deadline and BFQ are applicable to single HW queues so flag each of these as single HW queue-friendly. Cc: Johannes Thumshirn <jthumshirn@suse.de> Cc: Christoph Hellwig <hch@lst.de> Cc: Ming Lei <ming.lei@redhat.com> Cc: Damien Le Moal <damien.lemoal@wdc.com> Cc: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- block/bfq-iosched.c | 1 + block/elevator.c | 3 +++ block/mq-deadline.c | 3 ++- include/linux/elevator.h | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-)