Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 4092  / 3 Years ago, fri, august 20, 2021, 1:34:59

i am using ubuntu 12.04 .
If I build monolithic kernels for device drivers i.e driver will have its own kernel as i understand , will it really improves system performance and device performance ? are there any disadvantages ?


More From » kernel

 Answers
5

A pedantic note: "monolithic kernel" means something completely different. Linux kernel is always monolithic, regardless of whether some or all of its modules are built as LKMs or compiled directly into the kernel.



http://tldp.org/HOWTO/Module-HOWTO/x73.html#AEN77



When LKMs are loaded into the kernel, there's absolutely no difference in performance compared to built-in modules as LKMs code runs in the same process as the rest of the kernel, there's no inter-process communication or anything.




LKMs are not slower, by the way, than base kernel modules. Calling
either one is simply a branch to the memory location where it resides.




However, LKMs can be loaded upon request, so if you take the stock-standard Ubuntu kernel and recompile it with all modules built-in, you'll get a humongous kernel which probably will slow the system down because of using much more RAM for all those unused modules (which possibly will also cause all sorts of conflicts with each other).



On the other hand, if you compile a kernel which is custom-tailored to your particular machine and only has the modules for the actual machine's hardware built in, such kernel will likely to be faster than the stock-standard kernel, especially at boot time. I've been playing with a custom kernel for my EeePC on Arch Linux and can report that it's actually noticeably faster:




  • the kernel can be made very slim, including only features your machine actually uses. The whole kernel-eeepc thing is just 4Mb, which makes it faster to load from disk and it uses less RAM when loaded, leaving more memory for user-space programs.


  • no modules to load means less disk I/O during boot.


  • having hardware drivers built in means no need for hardware probing during boot, which saves time.


  • Built-in hardware drivers eliminate the need in the initial ramdisk, so the kernel can be loaded directly by GRUB.


  • you can disable other kernel features you don't need, which again shrinks the kernel size and make it faster.




The downsides, however, are:




  • Automatic kernel upgrades become useless, you have to build new kernels from source


  • If the machine dies and you plug the disk into another computer the machine probably won't boot.




All in all, this is a fun and educational exercise but not something I would consider doing on a machine which is not too hardware-restricted.


[#35908] Saturday, August 21, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terose

Total Points: 185
Total Questions: 125
Total Answers: 131

Location: Venezuela
Member since Mon, Dec 13, 2021
2 Years ago
terose questions
;