Can mdev replace udev in an ordinary linux distro?
Laurent Bercot
ska-dietlibc at skarnet.org
Mon Sep 19 13:38:06 UTC 2011
>> mdev could also be patched to be run as a "mdevd" daemon listening
>> to the netlink. That would solve the speed problem related to
>> /etc/mdev.conf parsing, and would still be orders of magnitude below
>> the complexity of udevd.
After closer examination of the mdev.c source code, I must say I was
wrong. As it is now, the /etc/mdev.conf file is parsed on every event.
(And it makes sense: since this file describes what to do on an event,
its natural to read it on an event.)
The only way to speed this up is to pre-parse the /etc/mdev.conf file:
compile it once into a fast access structure which can then be
interpreted on every event. This fast access structure could be stored
in memory, if we're to have a long-running "mdevd" program ; or it
could be stored as another, less user-friendly, file (for instance a
cdb file) if we're still going to have one mdev invocation per event.
I'm not sure this is worth it - mdev -s is only run once at boot time,
and once /etc/mdev.conf is in the filesystem cache, the parsing should
be CPU-bound, which means it can be run in parallel with other
initialization tasks (that are majorly IO-bound) without a performance
loss.
--
Laurent
More information about the busybox
mailing list