Re: udev is too slow creating devices

From: Andrea Arcangeli
Date: Wed Sep 15 2004 - 17:26:14 EST


On Wed, Sep 15, 2004 at 04:09:27PM -0600, Chris Friesen wrote:
> Andrea Arcangeli wrote:
>
> >the kernel certainly knows when it's about time to fork an userspace
> >process to create the device, doesn't it? then just wait4 while the
> >process is running.
>
> Last I checked, if using udevsend the process that gets forked is not the
> same process that actually creates the device node.

Good point, so wait4 wouldn't be enough, you'd need a bit more of API on
the udev side. But be sure, if dev.d can make it with a FIFO lock in
/var/run, then the kernel can make it too.

Also note the maybe usb is just completely async and when you load the
device driver you've no idea of when you'll get the signal and it's
impossible to make it sync, fine. I'm really not talking about hotplug,
hotplug basically has to be async by design.

But the microcode driver has nothing to do with hotplug or usb, and
waiting for the device creation in the insmod syscall is sure natural
and doable. Now if we don't want to create a little bit of API in udev
to let insmod provide a sync behaviour and force people into the dev.d
scripts and file locking in /var/run that it's one issue (you can aruge
about higher perf), but there is a whole large class of devices that are
not hot-pluggable and where the discovery is definitely synchronous,
even common pci is fully sync in its discovery when you call
pci_find_device/get_device.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/