Timer slack
Arjan van de Ven has proposed an enhancement to the timer API - called timer slack - which should make it easier to coalesce timer events. In essence, it adds a certain amount of fuzziness to timer expiration times, giving the kernel some flexibility in how the timers are scheduled. That fuzziness is set with:
void set_timer_slack(struct timer_list *timer, int slack_hz);
In essence, this call says that any timeout scheduled with the given timer can be delayed by up to slack_hz jiffies. By default, the slack is set to 0.4% of the total timeout period - a very conservative value. When the timer is queued, the actual expiration time is determined by means of a simple algorithm to choose a well-defined time within the slack period.
The value of this approach is that it makes it easy to coalesce timer
events from multiple sources without needing to change every call site.
Additional flexibility can then be had by increasing the slack for
specific, frequently-used timers, but, even without that, slack timers
should improve power efficiency on many systems.
| Index entries for this article | |
|---|---|
| Kernel | Timers |
