Linux Poetry
{tags: cpu management }
prev

The Idle Thread
Doing nothing is complex
for an operating system;
running in an infinite loop,
responding to interrupts.

CPUs have low power states,
tiered, components powered down -
the time to resume full activity
described as exit latency.

A lower power state,
means higher exit latency -
the appropriate idle state
depends on context.

Defined in <linux/cpuidle.h>,
changes are applied via driver modules;
cpuidle drivers enact idle states,
by registration with CPUs.

Heuristics determine state,
upcoming timer events are measured,
guessing the most efficient way
to get nothing done.

process.c

/* The idle thread. There's no useful work to be
  * done, so just try to conserve power and have a
  * low exit latency (ie sit in a loop waiting for
     * somebody to say that they'd like to reschedule)*/
void cpu_idle(void) { ... }
07-15-2014 , rss feed license