|
|
Subscribe / Log in / New account

Selectable I/O schedulers for 2.6

The 2.5 development series saw the creation of a few different I/O schedulers ("elevators") for the block I/O subsystem. I/O schedulers attempt to perform requested block I/O operations in an order that maximizes performance. Given that different people (and applications) measure performance differently, it is not surprising that more than one I/O scheduler exists. So, for example, the "deadline" scheduler attempts to minimize seeks while ensuring that no request waits for more than a certain period of time. The anticipatory scheduler pauses after completing read operations on the assumption that another nearby read will show up quickly. The CFQ ("completely fair queueing") scheduler tries to divide up the available I/O bandwidth equally among processes. And there is a "noop" scheduler for devices (such as memory-based devices) which do not benefit from I/O scheduling logic at all.

What has been lacking is any sort of way for a system administrator to choose between these schedulers. A system I/O scheduler can be designated with the elevator= boot parameter, but that choice applies to all drives on the system, and it cannot be changed. This restriction makes experimenting with the various schedulers difficult; in the real world, it may also be appropriate to use different schedulers for different drives.

So Nick Piggin has released a patch which makes I/O schedulers selectable at run time. With the patch, a new io_scheduler sysfs attribute appears under /sys/block/<device>/queue; changing a scheduler is simply a matter of writing the name of the new scheduler into that attribute. So, for example, to go to CFQ on the first SCSI drive:

    echo cfq >/sys/block/sda/queue/io_scheduler

Changing schedulers requires pausing and emptying the I/O queue, so it might not be advisable in the middle of writing a CD or controlling a nuclear power plant shutdown. But it certainly can be a useful thing to do at system initialization time, or while experimenting with scheduler performance under a certain kind of load.


to post comments

Selectable I/O schedulers for 2.6

Posted Sep 25, 2003 2:32 UTC (Thu) by Nick (guest, #15060) [Link]

Please use this patch instead.
http://www.kerneltrap.org/~npiggin/elv-select.patch-030924-2

Better yet, just go to http://www.kerneltrap.org/~npiggin/, as I may have a
newer version. Have fun.

Selectable I/O schedulers for 2.6

Posted Sep 25, 2003 14:06 UTC (Thu) by alspnost (guest, #2763) [Link] (1 responses)

You mean people are using 2.6.0-test5 to conrol nuclear power plant shutdowns? And I thought SCO was worrying enough ;-)

Selectable I/O schedulers for 2.6

Posted Sep 25, 2003 14:24 UTC (Thu) by StevenCole (guest, #3068) [Link]

They might be better off if they did. Here is an interesting article: Slammer worm crashed Ohio nuke plant network

In regards to changing the elevator, you will need to mount sysfs first. Create a /sys mountpoint, and

mount -t sysfs sysfs /sys


Copyright © 2003, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds