Lably
Skip to content

O(1) scheduler

Historical Linux 2.6 kernel process scheduler

  • 2 min read
  • 4 chapters

Related on Lably

Through Big O notation, Process (computing) and Operating system

In the realm of real-time operating systems, deterministic execution is key, and an O(1) scheduler was able to provide scheduling services with a fixed upper-bound on execution times.

The O(1) scheduler was used in Linux releases 2.6.0 through 2.6.22 (2003-2007), at which point it was superseded by the Completely Fair Scheduler.

Overview

The Linux scheduler was overhauled completely with the release of kernel 2.6 in 2003. The new scheduler was called the O(1) scheduler. The algorithm used by the O(1) scheduler relies on active and expired arrays of processes to achieve constant scheduling time. Each process is given a fixed time quantum, after which it is preempted and moved to the expired array. Once all the tasks from the active array have exhausted their time quantum and have been moved to the expired array, an array switch takes place. Because the arrays are accessed only via pointer, switching them is as fast as swapping two pointers. This switch makes the active array the new empty expired array, while the expired array becomes the active array.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication