Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-06-2009, 06:20 PM   #1
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
Kernel Compiling: Static vs. Module

I've read a few pages, like this one, which indicate that there are slight performance increases when you compile kernel components statically rather than as LKMs. This is supposed to be because there is less memory fragmentation. I was wondering if anyone knew about any studies providing performance statistics relating to that issue.

I don't need this for a research paper or anything... I just would like to have a little more insight next time I recompile my kernel.
Old 08-08-2009, 03:11 AM   #2
Simon Bridge
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
The main advantage for having a static module is if something is needed very early in the boot process. File system modules for eg.

The performance difference is just machine cycles used to load the module, nothing fancy. You'll notice it on slow systems or those with very restricted resources. Or if you have a system which is constantly loading and unloading thousands of modules.
Old 08-08-2009, 03:33 AM   #3
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,814

Rep: Reputation: 2171Reputation: 2171Reputation: 2171Reputation: 2171Reputation: 2171Reputation: 2171Reputation: 2171Reputation: 2171Reputation: 2171Reputation: 2171Reputation: 2171
Crazy talk IMHO.
The kernel is page fixed - branching to/from loaded modules or "in-kernel" is going to be similar. I strip my kernels to make them faster to compile - that applies especially to modules. Rebuilding the modules for any of the "mega" distros take forever because there are so many of them. The only other "penalty" I can imagine is the time to load the module - insignificant in general.
I don't know of any papers - but I also don't know why anyone would bother testing this.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 01:45 AM
How to link a static library to a kernel module pallava Linux - Newbie 1 09-26-2007 08:25 PM
netfilter/iptables in kernel: module vs static -Nw- neX Linux - Security 5 03-25-2005 06:44 PM
true way on compiling kernel and static iptables klog2_k Linux - Software 0 07-15-2003 10:21 PM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:22 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