Saturday February 11, 2012 5:33 AM AEST

Kernel engineering

By Ashton Mills
12:42 Sep 12, 2007
Tags: Kernel | engineering | linux | vista
« 
Kernel engineering
Vista
Microsoft is well aware that the Windows XP, well, experience didn’t turn out to be quite the revolution it promised. In light of this, Vista’s kernel underwent a number of upgrades to help change this, including:

Multimedia class scheduler service: A new service boosts thread priorities of multimedia applications to try and prevent glitches in video and audio playback. Threads are boosted for 80% of the task’s clock rate, then dropped back to ensure other tasks can run.

IO cancellation: Many IO tasks can be prematurely cancelled, and this applies to network connections as well. So no more frozen Explorer when a network device times out.

IO prioritisation: Previously only CPU threads could be prioritised, but now certain IO-intensive jobs (like virus scanning) can be given a lower IO priority. There are five levels from Critical to Very Low. To ensure low priority tasks still get a look in, at least one low priority IO is processed every second.

IO bandwidth reservation: Similarly, some applications such as media streaming can request minimum bandwidth to ensure interrupt-free IO.

SuperFetch: Preemptively populates memory with data the kernel expects the user to need, thus providing faster response times, and uses IO prioritisation to ensure this doesn’t interrupt the user.

ReadyBoost: You know all about this one. It’s most beneficial for low-memory systems.

ReadyBoot: Analyses the last five boots and devises an optimised startup plan to reduce boot times. A RAM cache is dynamically built and destroyed on demand to facilitate this during boot. The end result is a snappier boot up, personalised to taste.

Parallel sessions: To further improve boot times, startup sessions can be launched in parallel during boot.

Delayed autostart: Some services have delayed start times, such as Windows Update, to allow faster logins. Again, these can take advantage of a low-priority IO assignment.

All this is rather nice if you’re running Vista, and shows just how seriously Microsoft takes the importance of a faster and more responsive desktop experience.

click to view full size image
For both Windows and Linux, media playback is considered an essential user experience that must work well.


Linux
Linux, as hinted at earlier, has come a long way in terms of user-friendly desktop-focused distributions. Unfortunately, as all of them still run the Linux kernel – which is certainly an efficient kernel – they don’t have heritage in the desktop space. In recent years a stronger focus for the desktop has led to a number of changes. Some of these have been around for a while but have been tweaked, while others – like CFS – are brand new.

Preemption model: The kernel has three default levels: None, Voluntary, and Preemptible. None is ideal for servers and maximises throughput; Voluntary allows low-priority processes to preempt themselves to allow applications to run more smoothly while under load; and Preemptible is similar to Voluntary but with a response time in the milliseconds that’s good for real-time systems.

Timer frequency: The default clock frequency within the kernel. The old 2.4-series kernels defaulted to 100Hz, but the 2.6 series has a wide range of options from 100Hz to 5000Hz+. The faster the timer frequency, the quicker the kernel will respond to interactive events. 100Hz is recommended for servers and 1000Hz is considered ideal for desktops. In typical kernel developer humour, the kernel configuration dialogs note that anything above 1000Hz is ‘Insane’ and anything above 5000Hz ‘Obscene!’

CFQ: The Completely Fair Queuing IO scheduler is a relatively recent development and ensures balanced and fair IO access ideal for desktop systems. By comparison, servers will usually fare better with the Deadline IO scheduler, while the original Anticipatory scheduler sits somewhere in-between.

CFS: The Completely Fair Scheduler is brand-spanking new as of the 2.6.22 kernel and aims to address some of the CPU scheduling issues that can impede desktop performance. Despite its title, the CFS will actually priortise some tasks to ensure a fast and responsive desktop and applications, however it also ensures that programs can never completely starve – just as detrimental to performance.

Re-nicing: Programs have always been able to be re-niced (Read: Setting the ‘niceness’ level, aka thread priority) in Linux, however some recent kernel patches have taken to automatically re-nicing the X processes to prioritise the Linux GUI, further improving desktop responsiveness.

As with Vista, these are just some of the changes under the hood and, especially in the case of CFS, still under development.


Looking ahead
The illusion of multitasking and responsive desktops are just that, an illusion. Even in the age of multi-core CPUs, these rules still apply. But as Linux kernel developers place a stronger emphasis on desktop performance, and Microsoft continues to evolve its focus on the same theme, we will see further changes to the heart of our operating systems to enhance the desktop experience, especially as new technologies (like high-definition media, security, new hardware peripherals and so on) evolve.

 
« 
 
This article appeared in the September, 2007 issue of Atomic.

Behind the scenes with Mass Effect 3! GTX 560 VGA round-up! Essential Skyrim tweaks to improve your game! Plus reviews, news, hardware, more games, and easy to following modding guides for PC builders. ON SALE NOW!
 
Latest Competitions
 
Atomic Magazine

Issue: 133 | February, 2012

Atomic is a magazine aimed squarely at computer enthusiasts, gamers, and serious PC upgraders.

Every month we bring you the latest reviews of new technology and PC components, in depth features on everything from overclocking to console hacking, and gaming previews and interviews.
 
Latest Comments
 
Latest User Reviews
Battlefield 3 is the new benchmark online FPS
90%
A very fun and realistic multiplayer ride.
 
Antec Kuhler 920 - liquid cool
90%
Antec Kuhler 920 silent but effientive out of the box no maintence water cooling kit
 
Antec's Lanboy Air - our new favourite case
90%
Antec Lan boy Air in red a very cool design
 
Antec's Lanboy Air - our new favourite case
90%
This product overall is awesome.
 
MSI's GT780 laptop as fast as it gets
90%
Nice laptop
 
 
Close Get the February, 2012 issue of Atomic mailed to you for $8.95, including postage.

Buy nowDigital Version