Re: filemon

From: Michael Gmelin <grembo_at_freebsd.org>
Date: Tue, 30 Jul 2024 12:55:56 UTC

On Tue, 30 Jul 2024 11:38:57 +0200
Miroslav Lachman <000.fbsd@quip.cz> wrote:

> On 30/07/2024 11:10, Dag-Erling Smørgrav wrote:
> > Gary Jennejohn <garyj@gmx.de> writes:  
> 
> [..]
> 
> >> I also load it from /boot/loader.conf using filemon_load="YES"  
> > 
> > This does cause the module to be loaded at boot time, but it's
> > slower than loading it later, and it increases memory
> > fragmentation.  A better option is to include "filemon" in the
> > kld_list variable in /etc/rc.conf or /etc/rc.conf.d/kld.  For
> > instance,
> > 
> >      % cat /etc/rc.conf.d/kld/filemon
> >      kld_list="${kld_list} filemon"  
> 
> Does this also apply today? I recently read from someone on a mailing 
> list that the kld_list in rc.conf is no longer needed, that any
> problems it used to solve are solved, and that the preferred way is
> to load everything from loader.conf. So I'm curious, what's the right
> thing to do then? (I load most of my modules from rc.conf)
> 

I think this is what you're referring to, quoting Warner (emphasis is
mine):
https://lists.freebsd.org/archives/freebsd-current/2024-May/005953.html

w> Also, in this case, kld_list is a terrible place to load the files.
w> You're better off loading them with xxx_load=YES in loader.conf. The
w> reason is that both uhid and ums will match your mouse. kld_list
w> loads these in a random order (effectively) and the first one to
w> load will claim the device, since there's no re-probe when the next
w> one loads. **You should never use it, unless the module you're
w> loading isn't supported by the boot loader (like drm-kmod)**. The old
w> advice was to put everything in kld_list and it would speed up boot,
w> but all the performance bugs in the boot loader have been fixed by a
w> combination of moving to UEFI (which is generally faster), BIOSes
w> with performance bugs disappearing 10 years ago and block caching
w> being added to the boot loader. It should almost always be empty or
w> just drm-mod these days (unless you somehow have special needs).
w>
w> By adding uhid last to this list in this way, you're guaranteeing
w> you'll hit this bug because it's not after ums, and that things
w> won't work.
w> 
w> Warner

Cheers

-- 
Michael Gmelin