Completely fair queueing

{{redirect|CFQ}}

{{refimprove|date=February 2013}}

Completely Fair Queuing (CFQ) is an I/O scheduler for the Linux kernel which was written in 2003 by Jens Axboe.{{ Cite web | title=Source code of the IO scheduler, (contains copyright information in header) | accessdate=28 December 2017 | url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/block/cfq-iosched.c?id=8f34ee75decb80007ba77bba5a7384eadff4866d}}

Description

CFQ places synchronous requests submitted by processes into a number of per-process queues and then allocates 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 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 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 4 used this I/O scheduler as the default even though it used a kernel based on a 2.6.9.{{Cite news |title= Choosing an I/O Scheduler for Red Hat® Enterprise Linux® 4 and the 2.6 Kernel |author= D. John Shakshober |date= June 2005 |work= Red Hat magazine |url= http://www.redhat.com/magazine/008jun05/features/schedulers/ |accessdate= 20 November 2011 |url-status= dead |archiveurl= https://web.archive.org/web/20070827140757/http://www.redhat.com/magazine/008jun05/features/schedulers/ |archivedate= 27 August 2007 }}

= 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 filesystem.

= Kernel 2.6.13 (27 June 2005)=

CFQ scheduler moved to a new time sliced design dubbed CFQv3. Among other things, it implements [http://linux.die.net/man/2/ioprio_get ioprio_get(2)] and [http://linux.die.net/man/2/ioprio_set ioprio_set(2)] which allows user to set per-process I/O priorities, usually using [http://linux.die.net/man/1/ionice 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.{{Cite news |title= Linux Kernel 2.6.18 - Make CFQ the default IO scheduler |author= Jens Axboe |date= June 2006 |url= https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b17fd9bceb99610f6dc7998c9a4ed6b71520be2b |accessdate= 20 March 2016 }}

= Kernel 5.0 (2019-03-03)=

CFQ has been removed.{{Cite web |title= block: remove legacy IO schedulers |author= Jens Axboe |date= 2018-10-12 |url= https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f382fb0bcef4c37dc049e9f6963e3baf204d815c |accessdate= 2020-10-25 }}{{Cite web |title= Merge tag 'for-4.21/block-20181221' of git.kernel.dk/linux-block |author= Linus Torvalds |date= 2018-12-28 |url= https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0e9da3fbf7d81f0f913b491c8de1ba7883d4f217 |accessdate= 2020-10-25 }} CFQ evolved into Budget Fair Queueing (BFQ).{{cite web |url=http://algo.ing.unimo.it/people/paolo/disk_sched/ |title=Budget Fair Queueing I/O Scheduler}}{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=BFQ-Queued-Linux-4.12|title=BFQ I/O Scheduler Queued For Linux 4.12 - Phoronix|website=www.phoronix.com}}

See also

References

{{Reflist}}

Sources

  • [https://web.archive.org/web/20120412234117/http://kerneltrap.org/node/580 Short detail about CFQ] (archived from [http://kerneltrap.org/node/580 here])
  • [https://lwn.net/Articles/107314/ Coming in 2.6.10]