Sunday, August 3, 2014

The kernel block layer gets the block I/O requests from the user for the disk access.The kernel does not issue block I/O requests to the disk in the order they are received or as soon as they are received. Instead, it performs operations called merging and sorting to greatly improve the performance of the system as a whole. The subsystem of the kernel that performs these operations is called the I/O scheduler.

Kernel mainly uses below scheduling policies for disk access:

1. Complete Fair Queuing (CFQ)

2. Anticipatory

3. Noop

4. Deadline

Now suppose I want to get information about the current scheduling policy for one of my block device say CDROM.

As we know CDROM is represent in Linux as sr0 (can be sr1, sr2 etc. depending upon the number of same device type connected at that moment) node under /device directory.