What is the benefit of compiling your own linux kernel?

In my mind, the only benefit you really get from compiling your own linux kernel is:

You learn how to compile your own linux kernel.

It's not something you need to do for more speed / memory / xxx whatever. It is a valuable thing to do if that's the stage you feel you are at in your development. If you want to have a deeper understanding of what this whole "open source" thing is about, about how and what the different parts of the kernel are, then you should give it a go. If you are just looking to speed up your boot time by 3 seconds, then... what's the point... go buy an ssd. If you are curious, if you want to learn, then compiling your own kernel is a great idea and you will likely get a lot out of it.

With that said, there are some specific reasons when it would be appropriate to compile your own kernel (as several people have pointed out in the other answers). Generally these arise out of a specific need you have for a specific outcome, for example:

  • I need to get the system to boot/run on hardware with limited resources
  • I need to test out a patch and provide feedback to the developers
  • I need to disable something that is causing a conflict
  • I need to develop the linux kernel
  • I need to enable support for my unsupported hardware
  • I need to improve performance of x because I am hitting the current limits of the system (and I know what I'm doing)

The issue lies in thinking that there's some intrinsic benefit to compiling your own kernel when everything is already working the way it should be, and I don't think that there is. Though you can spend countless hours disabling things you don't need and tweaking the things that are tweakable, the fact is the linux kernel is already pretty well tuned (by your distribution) for most user situations.


Most users do not need to compile their own kernel, their distribution has done this work for them. Usually distributions will include a set of patches to either integrate with certain parts of the way the distribution works, backports of device drivers and fixes from newer, but unreleased versions of the kernel or features that they are pioneering with their users.

When you compile your own kernel, you have a couple of options, you can compile an official Linus Torvalds kernel, this will not include any of the patches or customizations that were added by your distribution (which can be good or bad) or you can use your distribution rebuild tool to build your own kernel.

The reasons you might want to rebuild your kernel include:

  • Patching bugs or adding a specific feature to a production system, where you can not really risk upgrading the whole kernel for a single fix or two.
  • To try out a particular device driver, or a new feature
  • To extend the kernel, work on it
  • testing some of the "Alpha" modules or features.

Many developers use it to create also custom versions of the kernel for embedded systems or settop boxes where they need special device drivers, or they want to remove functionality that they do not need.


Compiling the kernel yourself allows you to only include the parts relevant to your computer, which makes it smaller and potentially faster, especially at boot time. Generic kernels need to include support for as much hardware as possible; at boot time they detect which hardware is attached to your computer and loads the appropriate modules, but it takes time to do all that and they need to load dynamic modules, rather than having the code baked directly into the kernel. There's no reason to have your kernel support 400 different CPUs when there's only one in your computer, or to support bluetooth mice if you don't have one, it's all wasted space you can free up