Completely Fair Scheduler

Article on other languages:

del.icio.us del.icio.us
Digg Digg
Furl Furl
Reddit Reddit
Rojo Rojo
Add to OnlyWire

The Completely Fair Scheduler is the name of a task scheduler which was merged into the 2.6.23 release of the Linux kernel. It handles CPU resource allocation for executing processes, and aims to maximize overall CPU utilization while maximizing interactive performance.

Con Kolivas's work with CPU scheduling, most significantly his implementation of "fair scheduling" named Rotating Staircase Deadline, inspired Ingo Molnar to develop his CFS, as a replacement for the earlier O(1) scheduler, crediting Kolivas in a footnote.[1]

In contrast to the previous O(1) scheduler used in older Linux 2.6 kernels, the CFS scheduler implementation is not based on runqueues. Instead a red-black tree implements a 'timeline' of future task execution. Additionally, the scheduler uses nanosecond granularity accounting, the atomic units by which an individual process' share of the CPU was allocated (thus making redundant the previous notion of timeslices). This precise knowledge also means that no specific heuristics are required to determine the interactivity of a process, for example.[2]

Like the old O(1) scheduler, CFS utilizes a concept called "sleeper fairness", which considers sleeping or waiting tasks equivalent to those on the runqueue. This means that interactive tasks which spend most of their time waiting for user input or other events, get a comparable share of CPU time when they need it.

OS background

From Molnar's description, CFS is an implementation of a well-studied, classic scheduling algorithm called fair queuing.[citation needed]

Originally invented for packet networks, it had been previously applied to CPU scheduling under the name stride scheduling. However, it uses different terminology than normally applied to fair queuing; "service error" (the amount in which a process's obtained CPU share differs from its expected CPU share) is called "wait_runtime"; the term "queue virtual time" (QVT) was given the name "fair_clock" in Linux's adaptation.

The fair queuing CFS scheduler has a scheduling complexity of O(log N), where N is the number of tasks in the runqueue. Choosing a task can be done in constant time, but reinserting a task after it has run requires O(log N) operations, because the runqueue is implemented as a red-black tree.

CFS is the first implementation of a fair queuing process scheduler widely used in a general-purpose operating system.[citation needed]

See also

References

This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.


Giant Panda

Mercedes Car
James Bond Guide
This site monitored by SitePinger.net