Re: [PATCH] udev enhancements to use kernel event queue

Steven Dake (sdake@mvista.com)
Thu, 19 Jun 2003 17:10:23 -0700


Linus Torvalds wrote:

>On Thu, 19 Jun 2003, Steven Dake wrote:
>
>
>>A serialization methodology can be built on /sbin/hotplug, but it has
>>all of the problems that Linus previously talked about for a kernel
>>event queue. The difference is that the problem is moved to userland.
>>
>>
>
>Having event ordering is a trivial matter, and I'm not against adding a
>sequence number to /sbin/hotplug as part of the environment, for example.
>
>What I worry about is the situation where one big deamon handles
>everything, which makes it impossible to "hook in" to the thing without
>understanding the one big thing.
>
>The thing that makes /sbin/hotplug so wonderful is that it's stateless,
>and if you want to hook into it, it's absolutely _trivial_. Look at the
>default script there in redhat-9 for example, and it's obvious how to hook
>up to certain events etc.
>
>And why do people care about serialization anyway? Really? The whole
>notion is ludicrous. /sbin/hotplug _shouldn't_ be serialized.
>Serialization is bad. You should look at whatever problems you have with
>it now, and ask yourself whether maybe it should be done some other way
>entirely.
>
>
Serialization is important for the case of a device state change
occuring rapidly. An example is a device add and then remove, which
results in (if out of order) the add occuring after the remove, leaving
a dead device node in the filesystem. This is tolerable. What isn't as
tolerable is a remove and then an add, where the add occurs out of order
first. In this case, a device node should exist on the filesystem, but
instead doesn't because the remove has come along and removed it.

This occurance does happen much more often then you might think. When
changing disk partitions, for example, items are removed and then added
several times before the devices are finally instantiated.

Definately to be avoided.

Thanks
-steve

> Linus
>
>
>
>
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/