Twenty years ago, it was easy for an operating system kernel to go idle: when there were no tasks to run, “the idle loop” would be scheduled. Early idle loops were basically empty infinite loops that did nothing while waiting for the next interrupt to happen. This saved power simply by avoiding running instructions that needed power-hungry components such as the cache or FPU! Over time, changing technology has allowed multiple additional hardware mechanisms to reduce power to be introduced. With these new options available today, the idle loop is responsible for choosing and deploying the “best” way to go idle. As a brief reminder, entering and returning from an idle state has a cost, and that cost can be measured both in time and in energy. Typically, the shallowest idle state is “nearly free” to enter/exit, whilst deeper idle states have increasingly higher costs to enter and exit. If […]
Author: Daniel Thompson
Daniel Thompson is a principal software engineer at RISCstar Solutions, a software services company that works wherever open-source software meets modern RISC hardware. Daniel has spent his entire career working in and around embedded operating systems, working on everything from RTOS to powerful Linux-based edge servers. He is an experienced trainer and a specialist in using debug and observability tooling to tune real-time systems.


