block: Add default I/O scheduler option

This commit is contained in:
ztc1997 2024-08-29 14:48:06 +08:00 committed by Ksawlii
parent fbbabdb3bc
commit 136bbfd757
2 changed files with 30 additions and 1 deletions

View file

@ -64,6 +64,27 @@ config MQ_IOSCHED_SSG_CGROUP
help
Control Group for SamSung Generic IO scheduler.
choice
prompt "Default mq I/O scheduler"
default MQ_DEADLINE_DEFAULT
help
Select the I/O scheduler which will be used by default.
config MQ_DEADLINE_DEFAULT
bool "MQ Deadline"
depends on MQ_IOSCHED_DEADLINE
config MQ_KYBER_DEFAULT
bool "MQ Kyber"
depends on MQ_IOSCHED_KYBER
config BFQ_DEFAULT
bool "BFQ"
depends on IOSCHED_BFQ
config MQ_SSG_DEFAULT
bool "SamSung Generic I/O scheduler"
depends on MQ_IOSCHED_SSG
config NONE_DEFAULT
bool "NONE"
endchoice
endmenu
endif

View file

@ -681,7 +681,15 @@ void elevator_init_mq(struct request_queue *q)
if (unlikely(q->elevator))
return;
if (!q->required_elevator_features)
if (IS_ENABLED(CONFIG_BFQ_DEFAULT)) {
e = elevator_get(q, "bfq", false);
} else if (IS_ENABLED(CONFIG_MQ_KYBER_DEFAULT)) {
e = elevator_get(q, "kyber", false);
} else if (IS_ENABLED(CONFIG_MQ_KYBER_DEFAULT)) {
e = elevator_get(q, "kyber", false);
} else if (IS_ENABLED(CONFIG_MQ_SSG_DEFAULT)) {
e = elevator_get(q, "ssg", false);
} else if (!q->required_elevator_features)
e = elevator_get_default(q);
else
e = elevator_get_by_features(q);