Completely Fair Queuing (CFQ) in Operating System

Several Linux I/O schedulers have been proposed. Some of these are:

  1. Completely Fair Queuing (CFQ)
  2. Deadline
  3. NOOP
  4. Anticipatory

CFQ is one of the input/output scheduler for the Linux kernel and is the current default scheduler in the Linux kernel.

What is kernel ?
Kernel is the central part of an operating system. It manages the operation between the hardware and the software. Every operating system has a kernel, for example the Linux kernel.

Completely Fair Queuing (CFQ) scheduler:
The Completely Fair Queuing (CFQ) scheduler is the I/O scheduler. The CFQ scheduler maintains a scalable per-process requests submitted by the processes into the number of per-process I/O queue and then allocate time for each of the queues to access the resource. This is done on the basis of the I/O priority of the given process.
In case of asynchronous requests, all the requests from all the processes are batched together into fewer queues according to their process’s I/O priority.

The CFQ scheduler divides the processes into 3 separates class:

  1. Real time (highest priority)
  2. Best effort
  3. Idle (lowest priority)

The real-time and best-effort scheduling classes are further subdivided into eight-eight I/O priorities.These priorities are 0 to 7. Zero(0) being the highest and 7 the lowest and 4 is the default priority within the class.

Process in the real time class are always performed before processes in best effort class, which is always performed before processes in the idle class. This means that due to the higher priority of the real time class, rest both class have to starve of the processor time. Processes are assigned to the best effort class by default.

When there is no other I/O pending in the system then the idle scheduling class are only serviced. Thus, it is very important to only set the I/O scheduling class of a process to idle if I/O from the process is not at all required for making further progress.

GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :


Please write to us at to report any issue with the above content.