blob: 520f6b857544ee09d1bdea1f6467da378938907f [file] [log] [blame]
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -03001===================
2Switching Scheduler
3===================
4
Alan D. Brunelle23c76982007-10-15 13:22:26 +02005Each io queue has a set of io scheduler tunables associated with it. These
6tunables control how the io scheduler works. You can find these entries
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -03007in::
Alan D. Brunelle23c76982007-10-15 13:22:26 +02008
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -03009 /sys/block/<device>/queue/iosched
Alan D. Brunelle23c76982007-10-15 13:22:26 +020010
11assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted,
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030012you can do so by typing::
Alan D. Brunelle23c76982007-10-15 13:22:26 +020013
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030014 # mount none /sys -t sysfs
Alan D. Brunelle23c76982007-10-15 13:22:26 +020015
Andreas Herrmann8614b002019-06-12 08:50:09 +020016It is possible to change the IO scheduler for a given block device on
17the fly to select one of mq-deadline, none, bfq, or kyber schedulers -
18which can improve that device's throughput.
Valdis Kletnieks73af9942006-04-19 09:23:09 +020019
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030020To set a specific scheduler, simply do this::
Valdis Kletnieks73af9942006-04-19 09:23:09 +020021
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030022 echo SCHEDNAME > /sys/block/DEV/queue/scheduler
Valdis Kletnieks73af9942006-04-19 09:23:09 +020023
24where SCHEDNAME is the name of a defined IO scheduler, and DEV is the
25device name (hda, hdb, sga, or whatever you happen to have).
26
27The list of defined schedulers can be found by simply doing
28a "cat /sys/block/DEV/queue/scheduler" - the list of valid names
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030029will be displayed, with the currently selected scheduler in brackets::
Valdis Kletnieks73af9942006-04-19 09:23:09 +020030
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030031 # cat /sys/block/sda/queue/scheduler
32 [mq-deadline] kyber bfq none
33 # echo none >/sys/block/sda/queue/scheduler
34 # cat /sys/block/sda/queue/scheduler
35 [none] mq-deadline kyber bfq