As described in /usr/src/linux/Documentation/block/switching-sched.txt , the I / O scheduler on any particular block device can be changed at runtime. There may be some delay, since previous scheduler requests are all blurred before using the new scheduler, but it can be changed without problems even when the device is in heavy mode.
# cat /sys/block/hda/queue/scheduler noop deadline [cfq]
Ideally, one planner should satisfy all needs. It does not seem to exist yet. The kernel often lacks the knowledge to choose the best scheduler for your workload:
noop often the best choice for block devices with memory (such as ramdisks) and other non-rotating media (flash), where trying to transfer I / O is a waste of resources.deadline is an easy scheduler that tries to limit latencycfq tries to maintain system-wide I / O bandwidth fairness
The default was anticipatory for a long time, and it got a lot of settings, but was removed in 2.6.33 (early 2010). cfq became default some time ago, as its performance is reasonable, and fairness is a good target for multi-user systems (and even single desktop computers). For some scenarios, databases are often used as examples, since they usually already have their own planning and access schemes and are often the most important service (so who cares about justice?) - anticipatory has a long history of being tunable for better performance at these workloads, and deadline very quickly transfers all requests to the base device.
ephemient Jun 18 '09 at 2:59 2009-06-18 02:59
source share