What's a CPU to do when it has nothing to do?
https://lwn.net/Articles/767630/ [lwn.net]
2018-10-11 17:55
Idle states are not free to enter or exit. Entry and exit both require some time, and moreover power consumption briefly rises slightly above normal for the current state on entry to idle and above normal for the destination state on exit from idle. Although increasingly deep idle states consume decreasing amounts of power, they have increasingly large costs to enter and exit. This implies that for short idle periods, a fairly shallow idle state is the best use of system resources; for longer idle periods, the costs of a deeper idle state will be justified by the increased power savings while idle. It is therefore in the kernel’s best interests to predict how long a CPU will be idle before deciding how deeply to idle it. This is the job of the idle loop.
source: HN