runtime switching of i/o scheduler

Submitted by divyesh minjrola
on January 5, 2006 - 11:21am

hello
i can change the I/O scheduler at run time by following command
echo scheduler_name > /sys/block//queue/scheduler

after this command [] brackets are found around I/O scheduler name in scheduler file
"But how do know which I/O scheduler is being used at particular moment."

beside this in linux 2.6.13(which i use) it registers all the I/O scheduler at boot time.
so if i want to add my i/o scheduler where should i make changes so that my scheduler get
registered and identified.

$ cat /sys/block/hda/queue/sc

Anonymous (not verified)
on
January 6, 2006 - 7:25am

$ cat /sys/block/hda/queue/scheduler
noop [anticipatory] deadline cfq

This means that { noop anticipatory deadline cfq } are registered, and anticipatory is being used on hda.

/* /usr/src/linux/include/linux/elevator.h */
int elv_register(struct elevator_type*);
int elv_unregister(struct elevator_type*);

Call them from your module_init/module_exit.
Reading through /usr/src/linux/block/*-iosched.c should be more than enough to get you started.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.