Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-15-2004, 10:30 PM
|
#1
|
Member
Registered: Dec 2003
Location: Chennai, India
Distribution: Arch Linux 0.7
Posts: 393
Rep:
|
built in or module? any difference
will there be a noticeable difference in speed if i load all required drivers as modules, or will my system be faster if the drivers i need are built directly into the kernel?as of now i load almost everything directly into the kernel...?
thanx..
|
|
|
10-16-2004, 02:31 AM
|
#2
|
Member
Registered: Aug 2004
Location: New York
Distribution: --------- Gentoo-2004.2 [2.6.8] Redhat-9 [2.6.6]
Posts: 545
Rep:
|
Compiling directly into a kernel vs. modules
You have two options for adding functionality to the kernel: building functions into the kernel (making a monolithic kernel) or adding them as modules.
Monolithic kernels:
Building a function into the kernel directly ensures that that function will be available at all times. The downside is that it makes your kernel bigger, increasing boot time, and ultimately using that much more memory to hold the kernel. If you are compiling a kernel to fit on a floppy so that you can boot Linux off a rescue floppy, space will become an issue.
Modules:
Building a function as a module allows that function to be loaded into memory as needed and unloaded when it is no longer needed. This helps keep your kernel small. It is very useful if, say, you are swapping hardware in and out of your system frequently. You could compile support for a variety of, say, sound cards as modules, and your Linux system will theoretically only load the driver that is appropriate for the hardware setup at the time.
Another benefit of building functions as modules is that parameters can be passed to the modules which can be useful in debugging your system if problems occur.
There are some considerations to be made when deciding if a kernel function should be modularized. A small performance penalty is paid as it takes a little time to get the module loaded and unloaded. There are some functions that are needed at boot time and these cannot be compiled as modules -- they need to be present in the kernel so your system can be loaded. For example, ext2/ext3/reiserfs file system support needs to be built into the kernel so that your partitions can be read, as you need to be able to read the filesystem to load modules. In my case, if I have PCMCIA support built into the kernel, then metworking works. If PCMCIA support is modularized, networking fails to start, probably because the PCMCIA support needs to be available very early in the boot process to set up networking.
General approach
The way that I approached kernel building was to see which functions I would need all the time versus the ones that I would only use infrequently. If it was a function that I would be using a lot, I built it directly into the kernel. Otherwise, I compiled it as a module. As I got more comfortable with recompiling the kernel, I started making more functions as modules, and honestly, have not seen that much change in system performance. On the other hand, my hardware setup is pretty static -- my machine is a laptop, and the only hardware option that I have is whether or not I have a USB mouse plugged into it.
The above stuff was contributed by wilburpan [Gentoo Forums]
All credits to him........
|
|
|
10-16-2004, 03:01 AM
|
#3
|
Member
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900
Rep:
|
If you're talking about required hardware drivers, the performance penalty will be negligible with modules, as the drivers will likely never be unloaded. By compiling in, you do save yourself potential module-loading issues (network module isn't loaded at boot, so you have to find out where your distro keeps its startup module file and edit that, and similar problems).
Realistically, in the case of modules you will want loaded all the time, there's not much benefit or penalty either way (except in vital situations, like your root FS  ). I like to compile in everything I know will *always* be needed, and make everything else modules.
|
|
|
10-16-2004, 03:36 AM
|
#4
|
Member
Registered: Dec 2003
Location: Chennai, India
Distribution: Arch Linux 0.7
Posts: 393
Original Poster
Rep:
|
ok ...thanx a lot!
|
|
|
All times are GMT -5. The time now is 11:50 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|