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

Re: How to reduce number of loaded kernel modules?

On Thu, Sep 1, 2011 at 2:53 AM, Csanyi Pal <csanyipal@gmail.com> wrote:
Darac Marjal <mailinglist@darac.org.uk> writes:

> On Wed, Aug 31, 2011 at 03:39:41PM +0200, Csanyi Pal wrote:
>> I have a rather impressive list of loaded modules. I'm not shure whether
>> are they really needed?
>> How can I know which modules I don't need so I can have those
>> blacklisted?
> Generally speaking, the kernel only loads modules it needs. Typical
> methods for this include udev discovering hardware (so the kernel loads
> the driver for it) or modules or user-space software depending on other
> modules (such as how the wireless system depends on some of the hashing
> modules).
> So, in a normal system, the modules are loaded because they are needed.
> (The corollary to this is that when modules are not needed, such as
> removing a device, they are unloaded).
> Blacklisting is usually only needed if you have a broken modules or
> there are two modules that service your needs and you need to use the
> other one (for example, a USB device might be detected as needed
> cdc-ether, but you know that actually it doesn't, so you blacklist
> cdc-ether).

I have an usb ethernet adapter that sometimes freezes my Debian SID
system. I have mailed this problem to the Bugzilla Kernel org here:

The developers advices me to reduce loaded modules.
How can I do that?

As I read it, they are trying to reduce the number of modules for
diagnostic purposes.  It isn't intended to fix the problem, but perhaps
allow a kernel dump to appear so there are some real details to
bite into for this bug report. 

This Debian wiki page might help for disabling the auto load
of modules.  The update-initramfs step is important, as many
modules load from within initfs, before your root partition is
even mounted.


Spend some time getting to know what they are, as disabling some can
cause the system to not boot up, or not very well.  I suspect you have
some sort of firewall package which is loading a lot of extra unnecessary
modules.  There is also a chance the bug is one specific to the specialized
iptables features provided by extra modules and your USB ethernet adapter driver.
Some iptables modules are marked experimental and should be avoided.
Modules such as nf_conntrack_amanda are not standard for basic rules set
up in iptables, so there is likely something bringing that along.

Reply to: