You often have a choice between putting a module into the kernel by
loading it as an LKM or binding it into the base kernel. LKMs have a
lot of advantages over binding into the base kernel and I recommend
them wherever possible.
One advantage is that you don't have to rebuild your kernel as often.
This saves you time and spares you the possibility of introducing an
error in rebuilding and reinstalling the base kernel. Once you have a
working base kernel, it is good to leave it untouched as long as
possible.
Another advantage is that LKMs help you diagnose system problems. A
bug in a device driver which is bound into the kernel can stop your
system from booting at all. And it can be really hard to tell which
part of the base kernel caused the trouble. If the same device driver
is an LKM, though, the base kernel is up and running before the device
driver even gets loaded. If your system dies after the base kernel is
up and running, it's an easy matter to track the problem down to the
trouble-making device driver and just not load that device driver
until you fix the problem.
LKMs can save you memory, because you have to have them loaded
only when you're actually using them. All parts of the base kernel stay
loaded all the time. And in real storage, not just virtual storage.
LKMs are much faster to maintain and debug. What would require a full
reboot to do with a filesystem driver built into the kernel, you can
do with a few quick commands with LKMs. You can try out different
parameters or even change the code repeatedly in rapid succession,
without waiting for a boot.
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.
[1]
Sometimes you have to build something into the
base kernel instead of making it an LKM. Anything that is necessary
to get the system up far enough to load LKMs must obviously be built
into the base kernel. For example, the driver for the disk drive that
contains the root filesystem must be built into the base kernel.