How to amp up the Linux kernel

Ashton Mills24 August 2006, 6:37 AM

It's a tough job, but someone has to test out the bleeding-edge hacks to the Linux kernel that can give you dramatically increased speed. But you don't actually have to be a command line guru to be able to take advantage of these...


Vanilla is boring.

Though it is, usually, at least stable. One of the inherent beauties of open-source software -- philosophical, developmental, and future-of-the-human-race issues aside -- is simply that you can play with it.

And there is no more an exciting area to play in than the Linux kernel.

Official releases are designed to be progressive, generally stable, updates -- they need to be, as they form the basis of distribution released kernels.

But new features, performance improvements, new hardware support and bug fixes don't just magically appear at each new version.

ashtonmills150.pngMany of them have been around much longer than their public debut would suggest -- usually, they dance their evolution on the machines of those who like to play with cutting-edge super-fast may-break-everything patches.

Machines just like mine, for instance!

In fact, while some may call it crazy to play with such kernels (come on, you don't install them on a production system *cough*) they provide an insight into where kernel development is going and -- if the patches mature and become stable -- what future official releases will see.

For the most part, feedback from those running these kernels is exactly what helps the development of these new patches along, sometimes with the aim of inclusion in mainline.

What patches am I talking about? There's loads! And fortunately, passionate users like me and you sometimes seek out the more interesting, pertinent, and potent patches and roll them up into a single, suck-it-and-see kernel for all to enjoy. Here's a few I've played with for a while now:

These are just a sample of kernels you can try. You'll notice they are generally based on '-mm' (Andrew Morton) and '-ck' (Australia's own Con Kolivas) which are, in themselves, a series of patches hand picked by the aforementioned kernel developers.

These are then added to with further patches hand-picked (frequently from the Linux Kernel Mailing List by the above patchset authors.

Generally, due its roll-your-own nature, a lot of these patchsets are released with Gentoo ebuilds, but all of the above include inistructions for installing these kernels manually as well.

While there's always a wide range of tweaks with each set coming from, quite frequently, dozens of patches there are a few interesting developments making their way through at the moment. These include:

Nick-Piggins' Lockless pagecache - improved performance and scalability by providing lockless pagecache operations.

Staircase CPU scheduler - a new and improved scheduler over the default Ingosched.

Reiser4 - Hans Resier's latest super-fast filesystem.

Adaptive file read-ahead - a more advanced version of the kernel's read-ahead algorithm.

Layer 7 - packet filtering for detecting layer 7 applications (i.e, P2P software packets et al.)

Adjustable timer frequencies - a value of '864' is being pushed as perfect for desktops to provide a balance between throughput and responsiveness.

And this is just a snippet of some of the new features you can find. Don't be afraid to try some of the above kernels -- even just flicking through the 'make menuconfig' options can be a revealing insight.

Finally, though it's always a forum of much debate, those patchsets that are stable can frequently offer a noticeable performance improvement for your system.

Just remember to ensure you include all the required modules your distribution expects, or you may get unwanted behaviour that isn't a result of the kernel itself.

Naturally, the best way to do this is to extract the kernel sources for the kernel you are using on your distribution, copy across its '.config' file, and run 'make oldconfig' in the new kernel tree.

This is all getting beyond the scope of this piece however, but if there's enough interest I can write a short guide for Ubuntu by way of example.

Post your comment



Comments

RSS feed Email alert

lefty.crupps:

Yes, I would love to see a tutorial for (K)Ubuntu kernel rolling, including instructions on adding patches but keeping it as similar as desired (or not) to the original kernels...

29 February 2008, 8:28 PM (2 years ago)report abuse Send to a friend reply

ubuntu fan:

I too would love to see a tutorial on Ubuntu kernel rolling. I am using ubuntu on a multiboot system at present. I am not yet ready to fully take the 'plunge' however I am finding that it definitely has it's strong points.

29 February 2008, 8:28 PM (2 years ago)report abuse Send to a friend reply

Stomfi:

I would like to see a 64 bit kernel compile on an AMD 64 bit system with large memory option and the recent real time patches, (not officially due till 2.6.22).

Some proprietary CAD/CAM applications like the one from Unigraphics, have been ported to Linux64. The per process limitations of the Windows/Intel platform prevents certain CAD/CAM processes from being carried out, which I think are overcome by the Linux platform.

The addition of the real time patches would make Linux64 a very productive desktop system for this type of work. What do you think?

On another issue, I usually recompile my home system to only include those dynamic modules I need from the standard distro version, add some that are missing like acx-100 support, and my NX-Pro webcam, and leave out static modules like SCSI drives, as I'm still on IDE, and to include the CK speed up options in the config.

It's always a problem when updates and patches want to see the standard version, so I save my config file and extra modules and have both kernels in the GRUB menu. I boot from the standard when installing kernel patches, then recompile again with my prefernces.

Hopefully there is a better easier way?

29 February 2008, 8:28 PM (2 years ago)report abuse Send to a friend reply

Andrea:

To compile a kernel the Debian way you should look at the "kernel-package" package, probably is present in the Ubuntu repository. But, IMHO, there are better ways to spend your time instead with tinkering with kernel patches... (=

29 February 2008, 8:28 PM (2 years ago)report abuse Send to a friend reply

Darren:

Isn't Andrew Morton an Australian too ?

Nice article BTW.

29 February 2008, 8:28 PM (2 years ago)report abuse Send to a friend reply

anonymous user Anonymous user

April APC on sale now!

Tags