All of lore.kernel.org
 help / color / mirror / Atom feed
* Race condition on device add hanling in xl devd
@ 2018-12-16  1:47 Marek Marczykowski-Górecki
  2018-12-17  9:40 ` Roger Pau Monné
  0 siblings, 1 reply; 15+ messages in thread
From: Marek Marczykowski-Górecki @ 2018-12-16  1:47 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1459 bytes --]

Hi,

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
udev?

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
uevents)?

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
   domU
 - 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 #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-02-28 12:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-16  1:47 Race condition on device add hanling in xl devd Marek Marczykowski-Górecki
2018-12-17  9:40 ` Roger Pau Monné
2018-12-17 12:00   ` Marek Marczykowski-Górecki
2018-12-17 12:18     ` Roger Pau Monné
2018-12-17 12:23       ` Marek Marczykowski-Górecki
2018-12-17 13:05         ` Roger Pau Monné
2018-12-17 13:11           ` Paul Durrant
2018-12-17 14:32             ` Roger Pau Monné
2018-12-17 14:42               ` Paul Durrant
2018-12-17 16:09                 ` Roger Pau Monné
2019-02-24 23:14                   ` Marek Marczykowski-Górecki
2019-02-28 10:08                     ` Roger Pau Monné
2019-02-28 12:38                       ` Marek Marczykowski-Górecki
2018-12-17 13:23           ` Marek Marczykowski-Górecki
2018-12-17 14:44             ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.