Alan D. Brunelle | 23c7698 | 2007-10-15 13:22:26 +0200 | [diff] [blame] | 1 | To choose IO schedulers at boot time, use the argument 'elevator=deadline'. |
| 2 | 'noop', 'as' and 'cfq' (the default) are also available. IO schedulers are |
| 3 | assigned globally at boot time only presently. |
| 4 | |
| 5 | Each io queue has a set of io scheduler tunables associated with it. These |
| 6 | tunables control how the io scheduler works. You can find these entries |
| 7 | in: |
| 8 | |
| 9 | /sys/block/<device>/queue/iosched |
| 10 | |
| 11 | assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted, |
| 12 | you can do so by typing: |
| 13 | |
| 14 | # mount none /sys -t sysfs |
| 15 | |
Valdis Kletnieks | 73af994 | 2006-04-19 09:23:09 +0200 | [diff] [blame] | 16 | As of the Linux 2.6.10 kernel, it is now possible to change the |
| 17 | IO scheduler for a given block device on the fly (thus making it possible, |
| 18 | for instance, to set the CFQ scheduler for the system default, but |
Randy Dunlap | 17a9e7b | 2010-11-11 12:09:59 +0100 | [diff] [blame] | 19 | set a specific device to use the deadline or noop schedulers - which |
Valdis Kletnieks | 73af994 | 2006-04-19 09:23:09 +0200 | [diff] [blame] | 20 | can improve that device's throughput). |
| 21 | |
| 22 | To set a specific scheduler, simply do this: |
| 23 | |
| 24 | echo SCHEDNAME > /sys/block/DEV/queue/scheduler |
| 25 | |
| 26 | where SCHEDNAME is the name of a defined IO scheduler, and DEV is the |
| 27 | device name (hda, hdb, sga, or whatever you happen to have). |
| 28 | |
| 29 | The list of defined schedulers can be found by simply doing |
| 30 | a "cat /sys/block/DEV/queue/scheduler" - the list of valid names |
| 31 | will be displayed, with the currently selected scheduler in brackets: |
| 32 | |
| 33 | # cat /sys/block/hda/queue/scheduler |
Randy Dunlap | 17a9e7b | 2010-11-11 12:09:59 +0100 | [diff] [blame] | 34 | noop deadline [cfq] |
| 35 | # echo deadline > /sys/block/hda/queue/scheduler |
Valdis Kletnieks | 73af994 | 2006-04-19 09:23:09 +0200 | [diff] [blame] | 36 | # cat /sys/block/hda/queue/scheduler |
Randy Dunlap | 17a9e7b | 2010-11-11 12:09:59 +0100 | [diff] [blame] | 37 | noop [deadline] cfq |