Check out the new USENIX Web site. next up previous
Next: Related Work Up: Introduction Previous: What Useful Scheduling Models

Brief Overview of the Linux Scheduler

Linux supports 3 scheduling policies: SCHED_FIFO, SCHED_RR, and SCHED_OTHER. SCHED_OTHER is the default universal time-sharing scheduler policy used by most processes; SCHED_FIFO and SCHED_RR are intended for special time-critical applications that need precise control over the way in which runnable processes are selected for execution.

A static priority value is assigned to each process and scheduling depends on this static priority. Processes scheduled with SCHED_OTHER have static priority 0; processes scheduled under SCHED_FIFO or SCHED_RR can have a static priority in the range 1 to 99.

All scheduling is preemptive: If a process with a higher static priority gets ready to run, the current process will be preempted and returned to its wait list. The scheduling policy only determines the ordering within the list of runnable processes with equal static priority.

There is a single run-queue. The scheduler goes through each process in the queue and selects the task with the highest static priority. In case of SCHED_OTHER, each task may be assigned a priority or ``niceness'' which will determine how long a time-slice it gets. The ``counter'' attribute of each task determines how much time it has left in its time-slice. The scheduler selects the task with highest counter value as the next task to run. After every task on the run-queue has used up its time-slice (counter = 0), the counter for each task is set to the original priority + half the counter. In this way ``interactive tasks'' (tasks which were not in run-queue but whose counter was not zero) get a priority boost.


next up previous
Next: Related Work Up: Introduction Previous: What Useful Scheduling Models
Mansoor Alicherry 2001-05-01