Completely Fair Queuing (CFQ) is an
I/O scheduler for the
Linux kernel
The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU ...
which was written in 2003 by
Jens Axboe
Jens Axboe (born circa 1976) is a Linux kernel hacker.
Work
Axboe is the current Linux kernel maintainer of the block layer and other block devices, along with contributing the CFQ I/O scheduler, Noop scheduler, Deadline scheduler, io_uring an ...
.
Description
CFQ places synchronous requests submitted by
processes
A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic.
Things called a process include:
Business and management
*Business process, activities that produce a specific se ...
into a number of per-process
queues and then allocates timeslices for each of the queues to access the
disk
Disk or disc may refer to:
* Disk (mathematics), a geometric shape
* Disk storage
Music
* Disc (band), an American experimental music band
* ''Disk'' (album), a 1995 EP by Moby
Other uses
* Disk (functional analysis), a subset of a vector space ...
. The length of the time slice and the number of requests a queue is allowed to submit depends on the I/O 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 I/O 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 I/O thereby "anticipating" further close I/O from that process. It can be considered a natural extension of granting I/O time slices to a process.
History
Prior to the integration
In February 2003
Andrea Arcangeli
Andrea is a given name which is common worldwide for both males and females, cognate to Andreas, Andrej and Andrew.
Origin of the name
The name derives from the Greek word ἀνήρ (''anēr''), genitive ἀνδρός (''andrós''), that re ...
put forward his idea for a Stochastic Fair Queueing I/O scheduler to Jens Axboe who then implemented it. Jens Axboe made improvements to his first implementation, calling the new version the Completely Fair Queueing scheduler, and produced a patch to apply it to the 2.5.60 development series kernel.
Kernel 2.6.6 (10 May 2004)
The CFQ I/O scheduler was first integrated into the mainline kernel as an optional I/O scheduler. It was possible to change the scheduler at boot time with the 'elevator' parameter to kernel.
Kernel 2.6.9 (19 October 2004)
Red Hat Enterprise Linux
Red Hat Enterprise Linux (RHEL) is a Commercial software, commercial Open-source software, open-source Linux distribution developed by Red Hat for the commerce, commercial market. Red Hat Enterprise Linux is released in server versions for x86-6 ...
4 used this I/O scheduler as the default even though it used a kernel based on a 2.6.9.
Kernel 2.6.10 (24 December 2004)
The second release of the CFQ scheduler dubbed CFQv2 is included in the 2.6.10, improvements include better responsiveness and the elimination of some starvation issues which were present in the earlier version. The scheduler now is also switchable at run time by modifying the /sys/block/
/queue/scheduler variable in the sysfs
sysfs is a pseudo file system provided by the Linux kernel that exports information about various kernel subsystems, hardware devices, and associated device drivers from the kernel's device model to user space through virtual files. In addit ...
filesystem.
Kernel 2.6.13 (27 June 2005)
CFQ scheduler moved to a new time sliced design dubbed CFQv3. Among other things, it implement
ioprio_get(2)
an
ioprio_set(2)
which allows user to set per-process I/O priorities, usually usin
ionice(1)
command (although using nice(1) also modifies I/O priorities somewhat)
Kernel 2.6.18 (20 September 2006)
CFQ became the default scheduler, replacing the anticipatory scheduler.
Kernel 5.0 (2019-03-03)
CFQ has been removed. CFQ evolved into Budget Fair Queueing (BFQ).
See also
* Noop scheduler
The NOOP scheduler is the simplest I/O scheduler for the Linux kernel. This scheduler was developed by Jens Axboe.
Overview
The NOOP scheduler inserts all incoming I/O requests into a simple FIFO queue and implements request merging. This ...
* Deadline scheduler The deadline scheduler is an I/O scheduler for the Linux kernel which was written in 2002 by Jens Axboe.
Overview
The main goal of the Deadline scheduler is to guarantee a start service time for a request. It does so by imposing a deadline on ...
* Anticipatory scheduling Anticipatory scheduling is an algorithm for scheduling hard disk input/output (I/O scheduling). It seeks to increase the efficiency of disk utilization by "anticipating" future synchronous read operations.
I/O scheduling
"Deceptive idleness" is a s ...
References
Sources
Short detail about CFQ
(archived fro
here
Coming in 2.6.10
External links
Documentation of CFQ from the Linux source code
from RedHat's knowledge base
{{DEFAULTSORT:Cfq
Disk scheduling algorithms
Linux kernel features
Scheduling algorithms