Tickless Idle
Deferrable timersIn the Linux kernel, timers provide a way for any driver or kernel routine to register an event that needs to be handled at some point in the future. Some timers, used inside the kernel, are important to service in a sub-second interval when the system is busy, but are not critical when the system is idle. A prime example, is the timer usage in ondemand driver, which does a periodic sampling of CPU use. Accuracy is important for these timers when the CPU is busy because they are used to increase the frequency of a CPU to meet increased demand. But, while system is idle, ondemand governor can tolerate some delay and let the CPU remain idle for a longer time. To effectively handle such timers, the "deferrable timer" infrastructure was introduced in the Linux kernel. These deferrable timers are handled normally when the CPU is busy. However, when the CPU is idle, deferrable timers are queued until there is a non-deferrable timer or an interrupt that wakes the CPU from idle. Using deferrable timers significantly reduces the number of times a CPU is woken up from idle. The data in the table below is based on an Intel® Core™ 2 Duo-based test platform. The table shows the number of interrupts per second and the average time the CPU spends in idle state (in uS). Note that the kernel used during the measurement had tickless idle enabled with HZ being 1000.
|