Qwiki

Tickless Kernel







Tickless Kernel

A tickless kernel refers to an operating system kernel where timer interrupts do not occur at predefined intervals, but instead are generated only as needed. This approach offers significant benefits in terms of power efficiency and performance, especially for systems where power conservation is crucial, such as in mobile devices and embedded systems.

Background

Traditional operating system kernels use periodic timer interrupts, commonly known as "ticks", to maintain system time and manage scheduling tasks. These timer interrupts typically occur at a fixed frequency (e.g., 100 Hz, 250 Hz, or 1000 Hz), requiring the CPU to wake up at regular intervals, even when there is no work to be done. This can lead to unnecessary power consumption.

Implementation in Operating Systems

Linux Kernel

The Linux kernel introduced the tickless kernel feature starting from version 2.6.18. This feature, when enabled, allows the kernel to cease timer ticks during idle periods on systems equipped with an Advanced Programmable Interrupt Controller (APIC). Further enhancements were made in version 3.10 with the CONFIG_NO_HZ_FULL option, which allows non-idle processors to also benefit from a tickless environment.

Other Operating Systems

The concept of a tickless kernel is not unique to Linux. The XNU kernel used by Mac OS X from version 10.4 onwards and the NT kernel from Windows 8 also employ a tickless design. Similarly, Solaris 8 introduced a cyclic subsystem that supports arbitrary resolution timers and tickless operation. FreeBSD 9 also implemented a "dynamic tick mode" to achieve tickless functionality.

Benefits

  • Power Efficiency: By avoiding unnecessary timer ticks, the tickless kernel conserves power, which is particularly beneficial for battery-powered devices.
  • Improved Performance: Reducing the number of timer interrupts can enhance system performance, as the CPU can spend more time in low-power states without frequent interruptions.
  • Flexibility: It allows more precise management of system resources by generating timer interrupts only when necessary.

Applications

Tickless kernels are particularly advantageous in environments where power efficiency is critical. They are widely used in real-time operating systems such as FreeRTOS, which provides a tickless mode for low-power applications. Similarly, the Apache Mynewt operating system supports tickless priority-based scheduling, making it ideal for Internet of Things (IoT) devices.

Related Topics