kernel linker: Overriding a driver shipped with kernel via module?

Slawa Olhovchenkov slw at zxy.spb.ru
Wed Nov 19 08:59:50 UTC 2014


On Tue, Nov 18, 2014 at 04:59:18PM -0800, Xin Li wrote:

> >>> This becomes slightly more difficult for storage drivers which
> >>> must be loaded at boot time so the you can mount root from
> >>> it...  But yes, we are interested in methods to make it
> >>> easier/more automatic for modules to be loaded to support the
> >>> hardware that is present in a system...
> >> 
> >> When loader can load kernel -- loader can load driver module,
> >> this is not Linux (but yes, loader need plugable and stackable
> >> framework for access FS -- currenly booting from ZFS over gstripe
> >> not allowed).
> > 
> > That isn't the only issue.. another issue is identifing the
> > correct kernel module(s) to load at boot... iirc, you cannot unload
> > a kernel module loaded at boot time...
> 
> Actually the loader can unload everything ("unload"), and after that
> you would have to load them back individually.
> 
> The challenge is that having the same code in multiple modules would
> incur more I/Os (because the need to visit more file system
> structures, etc.) and possibly slightly more memory.  In loader stage,
> I/Os would be slow and doing so would slow down boot.  A way to

Some time ago Andrey V. Elsukov do some improvement at this point
(cashe improvement in loader). Now initialising and waiting USB stack need
more time that loading multiple modules.

> mitigate this is to compress the modules, but that would break a few
> applications like DTrace which needs to be taught to read compressed
> modules.
> 
> It would be, however, a win if we could strip down the kernel
> significantly and only load the _required_ modules that are sufficient
> to support the kernel to start /etc/rc, where we can load additional
> modules on demand (via devd for instance) because this would reduce
> I/O at loader stage.  I think we need to teach loader to determine
> which storage drivers and possibly NFS and network devices to load.

This is next step. First step -- switch to modulated kernel (we can't
switch to modulated kenel between minor releases and need switch
before freeze 11.0)



More information about the freebsd-arch mailing list