Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Switching static kernel to modules mostly/only?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sun Jul 24, 2016 8:41 pm    Post subject: Switching static kernel to modules mostly/only? Reply with quote

I have long been thinking about how I could just switch my existing running kernel to module loading instead of statically compiled in. I read that's the most recommended and fast way.
Does it make sense and how could I achieve it?
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13618

PostPosted: Sun Jul 24, 2016 10:37 pm    Post subject: Reply with quote

Where did you read such a thing? Module loading is more complicated at runtime than building all the required functionality into the kernel. In most cases, it will be faster and more efficient to use a monolithic kernel, assuming that the monolith is customized to include only the functionality that you will use. The main advantage to a modular kernel is that you can avoid loading functionality you do not need. This is a bonus for distribution kernels since they can build a small core and modules for everything the user might use. For Gentoo, where you build your own kernel, this is usually not needed.
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Mon Jul 25, 2016 5:45 am    Post subject: Reply with quote

I think I saw some discussions about it here. Hm, I see your point. Anyways, being a more or less computer literate person (a hobbyist), I might have plenty of stuff statically enabled that's not really needed. Plus being a person that always copies over kernel configs and doing make oldconfig (for years), there might be a lot of cruft loaded. Those were my main concerns for this post.
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13618

PostPosted: Tue Jul 26, 2016 1:25 am    Post subject: Reply with quote

You might have seen someone say that here. Unfortunately, some people say things that are wrong, or are correct only under limited circumstances that may not apply to your situation. Yes, a kernel with no tuning may have things you do not need. If this concerns you, you would be better off removing those features entirely, rather than converting them to modules. Some forum users may be able to help you identify options that are irrelevant to you, if you provide enough information about the computer and what functionality you expect to use. Start with lspci -k and grep -e '^[^#]' .config.
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Tue Jul 26, 2016 4:51 am    Post subject: Reply with quote

Thanks for the reply Hu. Having this Skylake laptop running really nicely lately, with all the energy saving features working as it seems, I might just use it as is and someday start over with a fresh kernel config on another machine ;)
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2540
Location: Near Toronto

PostPosted: Tue Jul 26, 2016 11:20 am    Post subject: Reply with quote

sometimes hardware acts funny and a rmmod / modprobe sequence
saves the day ... without a reboot
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3653
Location: Hamburg

PostPosted: Tue Jul 26, 2016 12:24 pm    Post subject: Reply with quote

For iptables it is nifty to simple add a missing module, recompile it and use it w/o a reboot.
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Tue Jul 26, 2016 8:05 pm    Post subject: Reply with quote

I heard it is even possible to hotswap the kernel without rebooting?
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13618

PostPosted: Wed Jul 27, 2016 1:16 am    Post subject: Reply with quote

toralf wrote:
For iptables it is nifty to simple add a missing module, recompile it and use it w/o a reboot.
Indeed, in those cases where it works, that is nice. However, some options require not just building the module, but also building additional support in the core kernel (such as added fields in data structures or even whole extra data structures), which the module will need to access for it to work properly. The core kernel features added that way need to be present in the running kernel or you cannot use the module. Thus, there are cases where building a kernel, changing the configuration, building new modules, and then loading the modules will not work. It is nice when it does work, but it cannot be relied on in the general case.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum