Can mdev replace udev in an ordinary linux distro?

Denys Vlasenko vda.linux at googlemail.com
Mon Sep 19 11:31:18 UTC 2011


On Mon, Sep 19, 2011 at 1:26 PM, Baruch Siach <baruch at tkos.co.il> wrote:
> On Mon, Sep 19, 2011 at 12:12:47PM +0200, Denys Vlasenko wrote:
>> On Fri, Sep 16, 2011 at 11:05 AM, Baruch Siach <baruch at tkos.co.il> wrote:
>> > Hi Walter,
>> >
>> > On Wed, Sep 14, 2011 at 11:55:08PM -0400, Walter Dnes wrote:
>> >
>> > [snip]
>> >
>> >>   Gentoo has /bin/busybox as part of the default system.  There is also
>> >> an option to build busybox with libraries statically linked.  IANAPP
>> >> (I Am Not A Professional Programmer), but I can do quite a bit of bash
>> >> scripting etc.  In Gentoo, the user generally knows what peripherals he
>> >> has permanently connected to the machine.  Plus you'll get the usual USB
>> >> keys and external drives being hooked up occasionally.
>> >>
>> >>   If mdev can replace udev a lot of Gentoo users would be very happy.
>> >> You might even have to start a separate "mdev-users" list <G>.
>> >
>> > I haven't seen a mention of the inherently racy nature of the hotplug
>> > mechanism on which mdev relies. Below is an explanation taken from
>> > http://www.kernel.org/doc/pending/hotplug.txt (down at the moment).
>> >
>> > <quote>
>> >
>> > A note about race conditions (or "why bother with netlink?"):
>> > =============================================================
>> ...
>> > In theory, transient devices (which are created and removed again almost
>> > instantly, which can be caused by poorly written drivers that fail their
>> > device probe) could have similar "leftover" /dev entries from the
>> > /sbin/hotplug mechanism.  (If two processes are spawned simultaneously, which
>> > one completes first is not guaranteed.)  This is not common, but theoretically
>> > possible.
>>
>> $SEQNUM thing is supposed to take care of that, no?
>
> AFAIK, there is no robust way for the mdev running on $SEQNUM == N to know
> whether the one doing $SEQNUM == N-1 has finished its business.

Nothing is 100.000000000000000000000000000000% robust.
/dev/mdev.seq is not robust enough for you?

> [snip]
>
>> If /dev/mdev.seq file exists, mdev will wait for its value
>> to match $SEQNUM variable. This prevents plug/unplug races.
>
> This assumes that the mdev of $SEQNUM == N-1 had a chance to run and update
> (or create) the /dev/mdev.seq file before the mdev doing $SEQNUM == N read it.
> What happens when the mdev of N-1 dies before updating mdev.seq?

Next mdev will run after 2 second timeout.


More information about the busybox mailing list