Improving idle behavior in tickless systems
Improving idle behavior in tickless systems
Posted Dec 31, 2018 21:24 UTC (Mon) by rweikusat2 (subscriber, #117920)In reply to: Improving idle behavior in tickless systems by Paf
Parent article: Improving idle behavior in tickless systems
The article contained the following statement:
Devices cause interrupts at (more or less) predictable intervals that depend on the applications that are running; a cpuidle governor can measure these intervals to make predictions for when the next device interrupt will occur.And this is simply not true. A NIC will generate interrupts in response to uncontrollable, external events for both sending and receiving. The same is true for any other kind of interrupt-using device not driven by the computer itself. As I already wrote, the very reason interrupts exist is to notify a CPU of some unpredictable change in state which needs to be handled now (or as close to now as possible) regardless of whatever else the CPU happened to be doing at the time of the event.
The code also doesn't even try to "predict" anything. After heuristically selecting some idle state based on the time until the next timer event, it compares the length of the last 8 idle periods against the 'target residency' of the selected state (in a seriously contorted way, BTW) and if more than half of them were smaller, selects a different idle state (simplification).
