Monday, June 25, 2007

Linux Kernel Development Goes Tickless

Via News.com -

Maybe you'd be better off if you didn't spend so much time looking at your watch.

That, loosely speaking, is the rationale behind a significant change at the heart of Linux that programmers hope will make the open-source operating system more efficient. New versions of the operating system are being endowed with a "tickless" kernel that forsakes traditional computer time-keeping in an effort to keep the processor in a somnolent, low-power state.

...

Some Linux developments take years to arrive, but the tickless kernel is now making its way into the Linux mainstream.

"The re-engineering has mostly been done," said Linux leader Linus Torvalds of the new kernel. And for higher-level software, PowerTop has been "invaluable, he added. "A lot of people and (Linux) distributions are actually interested in this, so the user applications do seem to be getting fixed."

There's more work to be done, but the progress has been measurable, said Arjan van de Ven, a longtime kernel programmer now working at Intel. "What we see in our lab today is that Linux on a laptop consumes 15 percent to 25 percent less power during idle than a code base of about three months ago," he said.

...

Obviously, processors can go into these power-saving states when a user commands a computer into standby mode. But a lot more can be done. Because gigahertz-frequency processor cycles last less than a billionth of a second, though, chips can actually enter and leave low-power states many times in the interval between two keystrokes of a fast typist.

But an operating system kernel--the core software that handles basic tasks such as scheduling processes and communicating with hardware--isn't always good at avoiding busywork. For one thing, software often needlessly prods the kernel into alertness. For another, the kernel itself can waste energy twiddling its thumbs when it could just as well be lowering its blood pressure and dozing off.

...

The tickless kernel still keeps track of time, but in a different way. Instead of checking frequently for work to be done--literally 1,000 times a second in the case of Linux, with each millisecond-long tick of the kernel's clock--the kernel schedules the hardware to interrupt it when it knows a future job will require its attention.

The tickless kernel provides another indirect benefit when it comes to power efficiency: It enables better use of virtualization, technology that lets multiple operating systems run simultaneously on the same computer, by replacing numerous idle machines with fewer, more efficiently used ones.

...

"Even though the kernel itself now has all the fundamental timer-handling knowledge, most of the kernel subsystems use some timers for their own handling, and tuning that usage will probably go on for some time," Torvalds said.

No comments:

Post a Comment