Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-04-2011, 03:07 PM   #1
LQ Newbie
Registered: Jun 2011
Posts: 3

Rep: Reputation: Disabled
Rebuild Kernel - How/Why?

Simple question for those with experience. My understanding is that rebuilding the kernel allows for the removal of unused drivers (and more?), making it smaller and improving performance.

I read this recommendation in an older document, so I don't know if it's still a common practice for Linux users.

So, how and why would one rebuild the kernel in an arbitrary distribution?
Old 07-04-2011, 03:17 PM   #2
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,134
Blog Entries: 2

Rep: Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839
I usually have only three reasons for compiling a kernel:

1. Enabling options that are not enabled in a standard kernel (or disabling enabled options).
2. Compiling drivers into a kernel that are compiled as modules in the standard kernel (to avoid the need of a initrd)
3. To try newer kernels that are not part of the distribution (yet).

I have no experience with that, but besides memory usage I doubt that a kernel with less drivers compiled will be faster. Nowadays the way to compile drivers that are not needed at boot-time is to compile them as modules. These modules will only be loaded if the appropriate hardware is found. i don't think that a not loaded module will cost performance.
1 members found this post helpful.
Old 07-04-2011, 03:27 PM   #3
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
In addition to TobiSGD's comments I would add that performance differences are minimal between differently compiled kernels of the same version. Look at for a recent comparison of performance between Linux kernels compiled with different options.

Last edited by stress_junkie; 07-04-2011 at 03:29 PM.
Old 07-04-2011, 03:39 PM   #4
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Hello kelleydv,

an advantage of a selfbuilt kernel is that you can configure the kernel to support your processor or your system better.

One important point is using more than 3GB of RAM on a 32bit-system, then you can configure your kernel for "HIGHMEM".

Also there is the section "Processor Type and Features" in the kernelconfiguration where you can chose to compile the kernel for your processor.

As TobiSGD stated, modules which aren't used don't matter. Otherwise it is a huge amount of work to configure a kernel in a way that it only supports your system without unnecessary modules and if you would do such a configuration, you will need much knowledge about your system (more than only the output of lspci).

If you decide to build your own kernel, you may want to look at the special configuration-method "make lokalmodconfig" which automatically choses the modules which are loaded when you run the command.

Old 07-04-2011, 04:23 PM   #5
Registered: Mar 2008
Posts: 16,883

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Two ways most people use that. One is to remove or add some feature to a generic kernel they got with a distro.

The other way is to build a single purpose kernel that is specific to your needs. It will be the fastest and most responsive on your system if you built it right. Kernel could be adjusted from a generic kernel that disto's offer to more closely follow your processing needs. There are many many options in those choice from starting with the correct processor and the list goes on and on for a few pages.

Remember that a kernel in a distro is made to run on a very broad range of systems. It includes everything but the kitchen sink.

Last edited by jefro; 07-04-2011 at 04:24 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rebuild Kernel alshaboti Linux - Kernel 3 12-03-2009 09:26 PM
Kernel rebuild? Whynot Linux - Kernel 2 03-02-2007 07:19 AM
How should I rebuild the Kernel waterox SUSE / openSUSE 5 10-02-2006 03:45 PM
Help (!?) with rebuild kernel 2.4.26 WoofDeF Debian 1 06-22-2005 09:11 AM
kernel rebuild Present Yoper 9 11-26-2004 06:08 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration