Linux 2.6.21: tickless idling

April 27, 2007

In Torvalds releases 2.6.21 kernel, Steven J. Vaughan-Nichols reports at length on the 2.6.21 kernel’s clockevents and dyntick (dynamic ticks) patches.

The result of these merges is a uniform timekeeping/scheduling interface (clockevents) and the ability to take the CPU into a true idle state if nothing is going on, shutting down the timer event and instead waiting for a regular interrupt or a scheduled, future event (this is dynticks).

This could apparently help with virtualization scheduling:

In the future, both these features will be used to improve virtualization. The virtualization manager — rather than scheduling by HZ — will determine which program or virtual operating system should have the lion’s share of the processor’s time. This is not a pie in the sky idea. The technique was already being used with Linux on IBM mainframes years ago, when trying to deal with a thousand virtual Linux servers at once using HZ scheduling. It lead to situations where the timer interrupt overhead alone was using up almost all of the processors’ time.

I’d imagine a thousand virtual servers splitting the system at once could do that 🙂

He points to this informative LWN article from February. That further explains clockevents and dynticks — but also suggests that going tickless during idle times is just the beginning for dynticks:

What’s in 2.6.21 is, thus, not a full dynamic tick implementation. Eliminating the tick during idle times is a good step forward, but there is value in getting rid of the tick while the system is running as well – especially on virtualized systems which may be sharing a host with quite a few other clients. The dynamic tick documentation file suggests that the developers have this goal in mind

Well. On to more important stuff this may promise: battery life! I am joining this LWN commenter, crossing my fingers:

I haven’t seen benchmarks on this in particular, but I remember reading a piece a while ago where a guy claimed that his laptop battery lasts TWICE as long with a 100Hz tick than with a 1000Hz tick… So, I’m expecting great things…