LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-04-2011, 04:07 PM   #1
kelleydv
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, 04:17 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
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, 04:27 PM   #3
stress_junkie
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 phoronix.com for a recent comparison of performance between Linux kernels compiled with different options.

http://www.phoronix.com/scan.php?pag...u_32_pae&num=1

Last edited by stress_junkie; 07-04-2011 at 04:29 PM.
 
Old 07-04-2011, 04:39 PM   #4
markush
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.

Markus
 
Old 07-04-2011, 05:23 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
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 05:24 PM.
 
  


Reply


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 2.6.31.6 alshaboti Linux - Kernel 3 12-03-2009 10:26 PM
Kernel rebuild? Whynot Linux - Kernel 2 03-02-2007 08:19 AM
How should I rebuild the Kernel waterox SUSE / openSUSE 5 10-02-2006 04:45 PM
Help (!?) with rebuild kernel 2.4.26 WoofDeF Debian 1 06-22-2005 10:11 AM
kernel rebuild Present Yoper 9 11-26-2004 07:08 PM


All times are GMT -5. The time now is 04:49 AM.

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