Linux Kernel – Benefits of Compiling Your Own

compilingkernellinux

What benefit could I see by compiling a Linux kernel myself? Is there some efficiency you could create by customizing it to your hardware?

Best Answer

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.

Related Question