Stop modprobe from loading every kernel module under the sun

Kernel News & Module Management

Stop modprobe from loading every kernel module under the sun

Technical Briefing | 8/8/2026

You probably think your kernel only loads the drivers it actually needs. It turns out that modprobe is often a bit too eager, dragging in dependencies you didn’t ask for just because a configuration file said so. This bit me in prod when a simple NIC driver upgrade triggered a chain reaction that loaded a bunch of redundant filesystem drivers, bloating the kernel memory footprint for no reason.

Why your dependency list is lying to you

When you run modprobe, it consults modules.dep to figure out what else needs to be pulled in. If you have softdep entries defined in your modprobe.d directory, the kernel loader treats these as hints to load extra modules. Most of the time this is harmless, but on high-density virtualization hosts, those extra drivers can lead to weird IRQ conflicts or just wasted cycles in the slab allocator.

lsmod | grep -o '^[^ ]*\s' | xargs modinfo | grep -E '^(name|depends):'

  • Check your /etc/modprobe.d/ directory for files overriding default module behavior
  • Use the ignore-install directive to prevent specific drivers from being force-loaded during boot
  • Audit the output of lsmod after a cold boot to identify modules that appear but have no attached hardware

Taking back control of the load order

If you really want to prune the cruft, blacklist the drivers you know you don’t need rather than just hoping they stay quiet. If a module isn’t loaded, it can’t cause an issue, and that’s the kind of stability I prefer. Once you have a clean list, lock it down so the next kernel update doesn’t decide to re-introduce your old headaches.

Linux Admin Automation  |  © www.ngelinux.com  |  8/8/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted