Difference between revisions of "Kernel Patches and Patchsets"

From ArchWiki
Jump to: navigation, search
(NOTE on compile times - please add to this!)
m (-mm: rm all traces of [unstable])
Line 98: Line 98:
 
==== -mm====
 
==== -mm====
  
A patchset so popular that it even has prebuilt Arch packages in the unstable repository, but that shouldn't stop you from playing with it yourself!  This patchset is maintained by [http://www.zip.com.au/~akpm/ Andrew Morton] and aims to increase the stability and performance of the Linux kernel. He aims to introduce bug fixes more quickly than mainline kernel and offers increased speed through a new disk I/O scheduler and realtime computing modifications, plus more.
+
This patchset is maintained by [http://www.zip.com.au/~akpm/ Andrew Morton] and aims to increase the stability and performance of the Linux kernel. He aims to introduce bug fixes more quickly than mainline kernel and offers increased speed through a new disk I/O scheduler and realtime computing modifications, plus more.
  
 
The -mm patches can be found at ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/
 
The -mm patches can be found at ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/

Revision as of 15:57, 14 December 2008


Using popular patches and patchsets - contributions greatly appreciated!

The number of posts on the forums about kernel patches and patchsets has been steadily increasing, prompting the drafting of this document which aims to be a definitive guide. It seems it would also be useful to reduce the need for every wiki to include a kernel patch howto!

There are lots of reasons to patch your kernel, the major ones are for performance or support for non-mainline features such as reiser4 file system support. Other reasons might include fun and to see how it is done and what the improvements are.

However, it is important to note that the best way to increase the speed of your system is to first tailor your kernel to your system, especially the architecture and processor type. For this reason using pre-packaged versions of custom kernels with generic architecture settings is not recommended or really worth it. A further benefit is that you can reduce the size of your kernel (and therefore build time) by not including support for things you don't have or use. For example, I always start with the stock kernel config when a new kernel version is released and I remove support for things like bluetooth, video4linux, 1000Mbit ethernet, etc. Stuff I know I won't use before i build my next kernel! However, this page is not about customizing your kernel config but I would recommend that as a first step to be combined with a patchset later.

PLEASE NOTE - most patchsets have a disclaimer attached to them - this is for good reason!

This document attempts to cover:

  • How to install the patched kernels
  • What the patchsets do and where to get them

How to install them

This is very easy if you have used abs and makepkg before, and easiest with the latest kernels. If you haven't built any custom packages yet you may like to leave this till after you have some experience. See also: ABS - The Arch Build System and The Arch package making HOW-TO - with guidelines

If you haven't actually patched or customized a kernel before it is not that hard and there are many PKGBUILDS on the forum for individual patchsets. However, I would advise you to start from scratch with a bit of research on the benefits of each patchset rather than jumping on the nearest bandwagon! This way you'll learn much more about what you are doing rather than just choosing a kernel at startup and wondering what it actually does.

The following wiki pages have also been written to aid the process of building a kernel with ABS:

  • Custom Kernel Compilation with ABS - this has been written especially to account for the variables used when patching the latest kernel versions, using the standard kernel versioning variables - a special patch version is also available

See also:

NOTE on compile times - please add to this!

You might be wondering how long it takes to build a kernel. As I already said that depends on the size (i.e. what drivers are included) but also on your hardware (CPU, RAM) and (ironically) which kernel you are already running!

DibbleTheWrecker
approx 1h - P3M 1Ghz
Mith
approx 20min - AMD AthlonXP2200+
RedShift
approx <10 min - AMD Athlon64 3500+/ 1 GB RAM
approx 50 min - Pentium III 1 Ghz / 512 MB RAM
approx 30 min - Dual Pentium III 866 Mhz / 1 GB RAM
Me (iphitus?)
approx 15 min - AMD AthlonXP2000+ / 512 MB RAM
hellwoofa
approx 15 min (1st run) / 6 min (2nd) - AMD AthlonXP3000+ / 512 MB RAM and ccache
Bavardage
approx 30 min - Intel CoreDuo T2050 @ 1.60GHz (with -j 4 makeflags)
EVRAMP
45min - Intel Celeron 2.4GHz / 512MB RAM
Tj
35 Minutes - Intel Pentium M 1.8GHz/512MB RAM (compiled only neccesay drivers and modules, heavily monolithic result).

Major patchsets

First of all it is important to note that patchsets are developed by a variety of people. Some of these people are actually involved in the production of the linux kernel and others are hobbyists - this should be considered to reflect a level of reliability and stability!

It is also worth noting that some patchsets are built on the back of other patchsets (which may or may not be reflected in the title of the patch). Patchsets (and kernel updates) can be released very frequently and often it is not worth keeping up with ALL of them so don't go crazy, unless you make it your hobby!

You can search google for more sets - remember to use quotes "-nitro" for example otherwise google will deliberately NOT show the results you want!

Could people please add their experiences and comments about different patchsets below esp. re: stability (crashes), reliability (fixes) and performance.

NOTE - this section is for information only - clearly no guarantees of stability or reliability are implied by inclusion on this page.

-beyond

Note: The beyond patchset development has been discontinued and is therefore not available in any Arch repositories.

Beyond is a patchset based on the CK patchset. Beyond aims to include a variety of popular features and updates that have not yet made it to the vanilla kernel, while remaining relatively stable. Con Kolivas' CK patchset is the most important part of Beyond, as it provides the great interactivity and responsiveness improvements.

website: http://iphitus.loudas.com/beyond.html

-ck

Note: The -ck patchset has been discontinued as of Linux 2.6.22-ck1. A replacement is the -rt patchset (see below).

These are patches designed to improve system responsiveness with specific emphasis on the desktop, but suitable to any workload. The patches are created and maintained by Con Kolivas, his site is at http://members.optusnet.com.au/ckolivas/kernel/. Con maintains a full set but also provides the patches broken down so you can add only those you prefer.

The -ck patches can be found at http://ck.kolivas.org/patches/2.6/

-rt

This patchset is maintained by a small group of core developers, led by Ingo Molnar. This patch allows nearly all of the kernel to be preempted, with the exception of a few very small regions of code ("raw_spinlock critical regions"). This is done by replacing most kernel spinlocks with mutexes that support priority inheritance, as well as moving all interrupt and software interrupts to kernel threads.

It further incorporates high resolution timers - a patch set, which is independently maintained.

[as said from the Real-Time Linux Wiki]

patch at http://www.kernel.org/pub/linux/kernel/projects/rt/

-grsecurity

Grsecurity is a security focused patchset. It adds numerous security related features such as Role-Based Access Control and utilizes features of the PaX project. It can be used on a desktop but a public server would receive the greatest benefit. Some applications are incompatible with the additional security measures implemented by this patchset. If this occurs, consider using a lower security level.

The -grsecurity patches can be found at http://grsecurity.net

-mm

This patchset is maintained by Andrew Morton and aims to increase the stability and performance of the Linux kernel. He aims to introduce bug fixes more quickly than mainline kernel and offers increased speed through a new disk I/O scheduler and realtime computing modifications, plus more.

The -mm patches can be found at ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/

-nitro

Another very popular patchset and one of the most discussed on the Arch forums, but it is not the most reliable or stable. Very popular with some gentoo users but disregarded as amateur by others. This patchset is predominately built on other patchsets. -nitro is maintained by a gentoo user and most frequently discussed on the gentoo forums http://forums.gentoo.org/.

- Tiny-Patches

"The -tiny tree is a series of patches against the 2.6 mainline Linux kernel to reduce its memory and disk footprint, as well as to add features to aid working on small systems. Target users are developers of embedded system and users of small or legacy machines such as 386s"

and maybe also for ricers ;-)

http://www.selenic.com/

-fallen

A newer patchset, aimed at providing most of the patches that -beyond had. It has the -ck patchset, fbsplash, reiser4, suspend2, latest 2.6.x.y patch, ACPI DSDT, squashfs, and Genpatches.

http://www.fallendusk.org/linux_patches/fallen/

-viper

"The main goal of this patchset is pretty much to offer the latest features, decrease latencies, decrease overhead, and improve interactivity. The only difference is experimental versions of everything."

Note that the creator and maintainer of this patchset passed away July 2007: http://forums.gentoo.org/viewtopic-t-572071.html

Individual patches

These are patches which can be simply included in any build of a vanilla kernel or incorporated (probably with some major tweaking) into another patchset. I have included some common ones for starters.

Reiser4

Reiser4FShowto - http://www.namesys.com

Gensplash/fbsplash

Gensplash - http://dev.gentoo.org/~spock/projects/


WikiMigration--dlanor 15:00, 23 Jul 2005 (EDT)