From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Date: Sun, 21 Jan 2001 12:49:22 +0000 Subject: Re: multiple events Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Oliver Neukum wrote: > > On Sonntag, 21. Januar 2001 13:29, Andrew Morton wrote: > > Oliver Neukum wrote: > > > Hi list, > > > > > > I was looking through the kmod code and was wondering about the context > > > /sbin/hotplug is run. > > > > > > It seems to be run in the context of keventd. Does this mean that there > > > can only be one instance of /sbin/hotplug at a time ? > > > > No, /sbin/hotplug is run asynchronously, so multiple instances > > can and will be run concurrently. A fix exists, but I'm still > > trying to get my head around whether there's justification > > for asking for its inclusion. > > Does this mean that "add" might race with "remove" ? Yes, easily. Cardbus devices can still generate several events quickly due to contact bounce. > On the other hand, if you go for serialisation, is there a possibilty of a > deadlock ? > device 1 -> hotplug -> module loaded -> device 2 registered -> hotplug -> > DEADLOCK You need to be careful with deadlocks. But it's OK with netdevices on cardbus and can probably be sorted out for other combinations. Actually, global serialisation of hotplug events would be a good thing to have. I guess this could be done in userspace. Which begs the question: why is the kernel running /sbin/hotplug at all? It would be better if the strings were squirted out to a daemon across a pipe or whatever, I suspect. I wasn't involved in those discussions - I may have missed something vital. Maybe /sbin/hotplug should just send a message to hotplugd and let hotplugd do all the serialisation? _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel