[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Race condition on device add hanling in xl devd


I've found a race condition with handling new devices in driver domain.
xl devd calls hotplug script when new device is detected in xenstore. At
the same time, asynchronously, kernel create actual backend device (vif
in my case). In rare circumstances (especially under high system load)
it may happen that hotplug script is executed before kernel create the
device, and the hotplug script fails. When hotplug scripts were called
by udev, that race didn't existed as udev was informed about the device
by the kernel.
I'm not sure if the race applies to backend in dom0 - haven't happened
to me, but that doesn't really prove anything.

Can you remind me why in driver domain xl devd is used now, instead of

A workaround could be implemented in hotplug script itself - wait for
the device there. I'm not sure how proper solution could look like. Some
synchronization between xl devd and the kernel (like xl devd monitoring

The setup:
 - Xen 4.8.4, but I believe the same would happen in xen-unstable
 - Linux 4.19.2 (dom0), Linux 4.14.74 (domU)
 - problem happens when starting a domU with network backend in another
 - happen more often when Xen run nested in KVM (-> slow), but happened
   to me on bare metal too

Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Attachment: signature.asc
Description: PGP signature

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.