[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How does Debian load the kernel modules



zhengda wrote:

Matus UHLAR - fantomas wrote:

yes, probably so. most of kernels get loaded when (first) used, but not
unloaded. I guess hotplug scripts load modules for every existing piece of hardware for the system to be able to use it. If you'd blacklist them, you
won't be able to use them, and some of your startup scripts may fail.

You can however check /etc/modules for modules you do not really need and
remove them.

I have removed the unnecessary modules listed in /etc/modules. But lsmod shows that there are 74 modules loaded, and 27 modules whose "used by" columns show 0.
So can I list all of these unused modules in /etc/hotplug/blacklist.d/?
By the way, does /etc/hotplug/blacklist have the same function of /etc/hotplug/blacklist.d/? In my system, there are both.


Well I wouldn't worry too much about the number of loaded modules. That, of course, assuming you are running a "modern" machine with several hundreds megabytes of RAM. Modules use just a tiny fraction of RAM: 30, 40k ... the largest one for me being Reiserfs with 200k. But assuming an average of 40k size, you'd be freeing up about 1MB of ram.

Of course if you're trying to run an embedded machine (for which you wouldn't be running debian) or an old machine with 24MB ram (the minimum for Debian), well in that case it would be an issue.

I wouldn't worry too much about it with a standard "modern" computer.

I wonder what happens to modules when the system needs RAM? I know Windows stupidly swaps the System memory by default (unless you enable the DisablePagingExecutive option in the registry). Does linux force the modules to stay in RAM or does it try to swap them when it's RAM-hungry?

Cheers,
Hernan



Reply to: