From 8d0ad065659d5f4e604267113180a3d24384a6a8 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Wed, 9 Sep 2020 15:43:17 +0000
Subject: Add comparison to mdev -d
---
doc/index.html | 40 ++++++++++++++++++++++++++++++++++++++++
doc/mdevd.html | 3 +++
2 files changed, 43 insertions(+)
(limited to 'doc')
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
mdev-like-a-boss.
+
+ Comparison with mdev -d
+
+
+
+ Recent versions of mdev
+have a -d option that allow it to run as a daemon. However,
+mdevd still has advantages over mdev -d:
+
+
+
+ - Better log management: mdev -d 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.
+ - Better memory efficiency: mdev -d uses its own environment
+(via putenv()
+and unsetenv())
+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.
+ - Better speed: mdev -d parses its config file for every
+event it receives, and has to perform expensive operations such as
+getpwnam()
+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.
+ - Independence from busybox: mdev is part of the
+busybox 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.
+
+
Installation
diff --git a/doc/mdevd.html b/doc/mdevd.html
index 4e68356..911b770 100644
--- a/doc/mdevd.html
+++ b/doc/mdevd.html
@@ -41,6 +41,9 @@ a daemon: it's long-lived, and there is only one instance,
reading a series of uevents and
performing actions without forking; the configuration file is
read and parsed only once.
+ Even when mdev is run as a daemon (via the recent -d
+option), there are technical advantages
+to running mdevd over mdev.
Interface
--
cgit v1.2.3