Skip to content
Related Articles

Related Articles

Completely Fair Queuing (CFQ) in Operating System

View Discussion
Improve Article
Save Article
Like Article
  • Difficulty Level : Medium
  • Last Updated : 30 Mar, 2020

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.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!