about summary refs log tree commit diff
path: root/doc/index.html
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-09-09 15:43:17 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-09-09 15:43:17 +0000
commit8d0ad065659d5f4e604267113180a3d24384a6a8 (patch)
treec27ce73cf692f6cf0f38ab6362b9cdcd129d6fa2 /doc/index.html
parente0fe751eb7678cd95a4edcbf851af7394a213c52 (diff)
downloadmdevd-8d0ad065659d5f4e604267113180a3d24384a6a8.tar.gz
mdevd-8d0ad065659d5f4e604267113180a3d24384a6a8.tar.xz
mdevd-8d0ad065659d5f4e604267113180a3d24384a6a8.zip
Add comparison to mdev -d
Diffstat (limited to 'doc/index.html')
-rw-r--r--doc/index.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/index.html b/doc/index.html
index f78398f..50ff20d 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -42,6 +42,46 @@ entirely compatible with advanced mdev usage such as
 <a href="https://github.com/slashbeast/mdev-like-a-boss">mdev-like-a-boss</a>.
 </p>
 
+<a name="mdev">
+<h2> Comparison with <tt>mdev -d</tt> </h2>
+</a>
+
+<p>
+ Recent versions of <a href="https://git.busybox.net/busybox/tree/util-linux/mdev.c">mdev</a>
+have a <tt>-d</tt> option that allow it to run as a daemon. However,
+mdevd still has advantages over <tt>mdev -d</tt>:
+</p>
+
+<ul>
+ <li> Better log management: <tt>mdev -d</tt> logs to a fixed text file, with
+all the issues it implies (need for the filesystem to be read-write,
+uncontrollable log file growth). By contrast, mdevd logs to stderr and its
+messages can be handled by any log infrastructure such as the one provided
+by a supervision suite. </li>
+ <li> Better memory efficiency: <tt>mdev -d</tt> uses its own environment
+(via <a href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/putenv.html">putenv()</a>
+and <a href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/unsetenv.html">unsetenv()</a>)
+to store uevent data for each event. This implies repeated allocations of
+heap memory. By contrast, mdevd does not use its own environment, and
+even does not use heap memory at all. </li>
+ <li> Better speed: <tt>mdev -d</tt> parses its config file for every
+event it receives, and has to perform expensive operations such as
+<a href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwnam.html">getpwnam()</a>
+every time it receives an event (which can add up to hundreds of time at boot!).
+By contrast, mdevd parses its config file only once, when it starts - or when
+it is told to read it again by a SIGHUP. So it processes events significantly
+faster. </li>
+ <li> Independence from busybox: <tt>mdev</tt> is part of the
+<a href="https://busybox.net/">busybox</a> software. It is an advantage
+when Busybox is also used to provide other functionality, such as
+coreutils or util-linux equivalents. However, some distributions find
+that functionality lacking in compatibility, and choose to use alternatives
+to busybox. In that case, having to use the whole busybox configuration
+and build process just for mdev is a drawback, and the code is bigger than
+it needs to be. mdevd, on the other hand, is independent software, and
+building it is simple and does not pull in any unnecessary code. </li>
+</ul>
+
 <hr />
 
 <h2> Installation </h2>