Linux Resource Management

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

CPU

Schedulers

CFS Scheduler

The CFS (Completely Fair Scheduler) aims at dividing the CPU time fairly among the processes. The processor time is divided in quantas, and for each quanta, the scheduler attempts to distribute the processor time fairly across the processes in the ready queue.

The implementation monitors the virtual runtime for each process (vruntime). At every scheduling point, if the process has run for t milliseconds, vruntime is incremented with t multiplied with the weight of the process, henceforth vruntime monotonically increases for a process. When a context change occurs (timer interrupt), always choose the task with lowest vruntime.

Relative priority amongst processes is enforced by the fact that the vruntime is updated proportionally with the process weight: for a lower priority process, vruntime increases faster, so the process returns to ready queue more often.

In order to pick the process with the lowest vruntime, the scheduler maintains a red-black tree.

RT Scheduler

TO DISTRIBUTE