It took longer than Linux creator Linus Torvalds would have liked, but the latest Linux kernel, version 2.6.21, has arrived. It brings many minor and major changes in how Linux handles process scheduling and time.
In his April 25th release note to the LKML (Linux Kernel Mailing List), Torvalds wrote, "If the goal for 2.6.20 was to be a stable release (and it was), the goal for 2.6.21 is to have just survived the big timer-related changes and some of the other surprises."
Surviving all those changes took time. "It's been over two and a half months, and while it's certainly not the longest release cycle ever, it still dragged out a bit longer than I'd have hoped for and it should have."
The delays came in large part because of "all the timer changes to support a tickless system (and even with ticks, more varied time sources)." Torvalds called timer-related improvements "the big change during 2.6.21."
A tickless system you ask? In 2.6.21, new technologies called clockevents and dyntick (dynamic ticks) were introduced. The technologies are based on previous real-time Linux work by Ingo Molnar and Thomas Gleixner. Together, they make the new kernel more efficient, both in terms of saving power, and in terms of dealing with heavy-duty multi-tasking jobs such as virtualization.
The clockevents feature provides a uniform interface and a device API for a computer's various timekeeping and scheduling devices. With this, developers don't need to delve down to the hardware level to work with a computer's timing mechanisms, making it much easier to program extremely accurate timekeeping.
The other new feature, dynticks, saves power by shutting down the system clock more completely during periods of idleness. It works like this.
With earlier kernels, the system clock keeps "ticking" the timer interrupt even when the system has gone idle, at a rate of 1,000 ticks per second, or 1GHz. That wastes a lot of Watts when the CPU is doing nothing but virtually twiddling its thumbs waiting for another job.
With Dynticks, the timer interrupt is turned almost off and the CPU waits for a real interrupt to come from a program, network interface, or the like. By idling your processor, you save energy -- and on a laptop, that's not a small matter.
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.
While no one is likely to be running that many Linux virtual machines anytime soon on typical x86 server hardware, the new Linux kernel does also feature many improvements to the VMI (Virtual Machine Interface) and KVM (Kernel Virtual Machine). With the former, a better interface for paravirtualization programs like Xen and VMWare has been introduced. In the later case, major improvements have been made to KVM 15, the hardware-based virtualization program that was introduced in Linux 2.6.20.
There were also numerous minor improvements. Some of the most significant of these were in the fields of network and audio device support.
One feature that was not included in 2.6.21 is the Reiser4 file system. For years now, it's been a major issue in developer circles whether this innovative and fast file system would become part of the Linux kernel.
When its designer and developer Hans Reiser was arrested for the murder of his wife in October 2006, it was assumed that development would stop on his file system and that would be the end of any chance of it being adopted by mainstream Linux.
It turns out that Reiser4 is still being maintained by programmers at Reiser's company, Namesys, and that there is still interest in having the file system in Linux. In a LKML note, Andrew Morton, the production Linux kernel maintainer, wrote that the problem with getting Reiser into Linux isn't Reiser's developers. "That's not where the problem lies -- the Namesys guys are responsive and play well with others."
While Morton hasn't "looked at the reiser4 code in ages," he doesn't see "anything like a list of outstanding technical issues." So Morton suggests that "to get it unstuck we'd need a general push; get people looking at and testing the code; get the vendors to have a serious think about it, etc. We could do that -- it'd require that the Namesys people (and I) start making threatening noises about merging it, I guess."
So, it could turn out that the big news in the next version of Linux may be the adoption of the Reiser4 file system. Failing that, you can expect to see more "tickless" and virtualization improvements in Linux's continuing evolution.
You can read the original, here.