Miracle patch set to turbocharge Linux kernel
Nov 17, 2010 — by Eric Brown — from the LinuxDevices Archive — 12 viewsHeralded by Linus Torvalds as a “huge improvement,” a 233-line kernel scheduling patch written by Mike Galbraith is making the rounds to rave reviews, reports Phoronix. Due for possible inclusion into Linux kernel 2.6.38, the “sched: autogroup” patch is claimed to reduce latency by a factor of 10, with noticeable improvements in 1080p video playback, according to “before-and-after” videos run at Phoronix.
Galbraith's scheduling patch is currently going through revisions, but his latest tests show the maximum latency dropping by over ten times and the average latency of the desktop reduced by about 60 times, says Phoronix.
The publication has yet to perform its own formal timed benchmarks, but has posted a "before and after" set of YouTube videos that show remarkable performance and video playback improvements during heavy multitasking on a Linux desktop (see farther below).
It's a "miracle patch" that "does wonders for the Linux desktop," writes the publication's Michael Larabel.
The "sched: autogroup" patch is already turning heads throughout the Linux kernel community, including that of the usually reserved Linus Torvalds (pictured).
"I'm (very happily) surprised by just how small that patch really ends up being, and how it's not intrusive or ugly either," writes the Linux creator in an email posted Nov. 14.. "I'm also very happy with just what it does to interactive performance."
Torvalds goes on to note, "It is a huge improvement" and makes group scheduling "a killer feature."
Torvalds, who helped "inspire" the idea for the patch, according to Phoronix, was particularly surprised at how much the patch improved web page loads. He had assumed that the CPU would not play such a big role there.
Torvalds, who oversees Linux kernel development under the auspices of the Linux Foundation, was also impressed by the small size of the patch. The patch adds 224 lines of code to the kernel's scheduler, says Phoronix. It strips away nine lines of code, so only 233 lines of code are in play.
The patch automatically creates task groups per TTY in an effort to improve the desktop interactivity under system strain, says Phoronix. In addition, it is said to allow the automated per TTY task grouping to be done dynamically on the kernel in real-time.
According to Larabel, the patch "has been working out extremely great on all of the test systems I tried it out on so far, from quad-core AMD Phenom CPUs systems to Intel Atom netbooks."
The test videos shown below ran on an Intel Core i7 970 system loaded with Ubuntu 10.10 (x86_64) and the GNOME desktop. The system was said to have used a prerelease version of the Linux kernel "nearing a Linux 2.6.37-rc2 state." The last formal kernel release was last month's Linux 2.6.36.
YouTube
video of test system before patch was installedSource: Phoronix
(Click to play)
YouTube
video of test system after patch was installedSource: Phoronix
(Click to play)
When the Linux kernel compilation load was doubled to 128 jobs, "the results are even more dramatic, but it is not great for a video demonstration," writes Larabel. He explains that the first video recorded under greater strain made the "before" video appear as like a still photograph.
Phoronix recently published the results of benchmarks performed on 26 Linux kernels dating back five years, from Linux 2.6.12 to a prerelease version of the upcoming Linux 2.6.37. Despite the addition of numerous features over the years, the results show remarkable consistency.
In addition to Galbraith's "sched: autogroup" patch, expected for merger into Linux 2.6.38, other recently developed patches may improve the kernel's performance considerably compared to recent years. These include Con Kolivas' BFS scheduler patches, as well as even more recent desktop responsiveness patches from Wu Fengguang and Kosaki Motohiro.
Availability
The latest revision of the Galbraith "sched: autogroup" kernel scheduling patch may be found here. The Phoronix story may be found here.
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.