MODPROBE: next generation
Denys Vlasenko
vda.linux at googlemail.com
Sun Jul 6 00:08:54 PDT 2008
[CC: busybox at busybox.net]
On Sunday 06 July 2008 08:27, Vladimir Dronnikov wrote:
> Hello, Denys!
>
> Looked through modutils-small.c. Could you explain the changes you
> made? I see the code became >500 bytes larger...
I made the following changes:
* directory scannig is done just once
* if we find module to modprobe during dirscan, we immediately
try to load it. If it succeeds, we exit. This makes modprobe
MUCH faster in some quite coomon cases.
* otherwise, we remember all module pathnames, so that we
do not need to scan directory again.
* If module was found but failed to load, we read ONLY that
module's body, determine deps, scan in-memory list of modules,
and try to load deps (recursively doing the same
"read body, find deps" for each of them).
* ONLY if module was not found by name, we read ALL module
bodies and find alias names. Very time consuming.
Still, as soon as alias is found, the module body reading
stops (cuts time down by 50% on average).
Then we try to load found module as above.
I decided to get the above logic working correctly so that
modprobe wouldn't scan whole module directory, and read
each and every module in it on every call; and turn
my attention to shrinking it later.
--
vda
More information about the busybox
mailing list