Thursday, April 19, 2007

I/O Schedule Changes

Recently, Patrick Volkerding has changed some kernel options related to I/O Scheduler. In the last -Current changelog, he rebuild the kernel with the default I/O Scheduler that was implemented since 2.6.18 kernel, which is CFQ. Here's some detail from Wikipedia:
CFQ, also known as "Complete Fair Queuing", is an I/O scheduler for the Linux kernel which was written by Jens Axboe.

CFQ works by placing synchronous requests submitted by processes into a number of per-process queues and then allocating timeslices for each of the queues to access the disk. The length of the time slice and the number of requests a queue is allowed to submit, depends on the IO priority of the given process. Asynchronous requests for all processes are batched together in fewer queues, one per priority. While CFQ does not do explicit anticipatory IO scheduling, it achieves the same effect of having good aggregate throughput for the system as a whole, by allowing a process queue to idle at the end of synchronous IO there by "anticipating" further close IO from that process. It can be considered a natural extension of granting IO time slices to a process.
I have changed my .config configure to have CFQ as the default I/O Scheduler, but i haven't recompiled my kernel yet, since i'm waiting for the next 2.6.21 release rather than upgrading to and then few days later, i will have to do another compilation.

I hope this changes will give an improvement to the overall system, since I/O Scheduler is one of the critical part where it can increase the performance of your system.