tech-kern archive

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

Re: Enabling built-in modules earlier in init

On Wed, 16 Jun 2010, Antti Kantee wrote:

I have to admit I haven't been following your work too closely, but
builtin modules are initialized either when all of them are initialized
per class or when their initialization is explicitly requested.  So if
whatever uses PCIVERBOSE requests the load of the PCIVERBOSE module,
it should be initialized and you should be fine (see module_do_load()).

The only "but" is that explicit loads must be accompanied by
MODCTL_LOAD_FORCE.  I wrote it that way because of the security use case:
if you disable a builtin module due to a security hole, you don't want
it to get autoloaded later.  For file system modules you can always use
rm, but for builtins you don't have that luxury.  So if that is actually
what you're chocking on, I suggest adding some flag to determine if the
module has ever been loaded and ignore the need for -F if it hasn't.

Yeah, my initial pass at the xxxVERBOSE modules used module_load() with MODCTL_LOAD_FORCE flag. And it worked just fine for both built-in and boot-loaded modules. Then, at John Nemeth's request, I modified it all to use module_autoload() which doesn't have the ability to specify the flag. I continued to test with boot-loaded modules, but never went back to check on built-ins. Hence my surprise yesterday when both jruoho@ and njoly@ reported that built-ins were not working!

I believe that it will not be too difficult to determine if a module has been explicitly unloaded. I think there is only one place in the code where an entry is removed from the active list and moved back to the builtin list.

| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at |
| Kernel Developer |                          | pgoyette at  |

Home | Main Index | Thread Index | Old Index