This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] [PATCH 0/2] Fix problems with vbd hotplug on Linux

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 0/2] Fix problems with vbd hotplug on Linux
From: Gary Grebus <Gary.Grebus@xxxxxxxxxx>
Date: Mon, 02 Nov 2009 16:35:06 -0500
Delivery-date: Mon, 02 Nov 2009 13:35:46 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird (X11/20090825)
When many PV domains are started in quick succesion, some domains fail to
start, with xend reporting: "Error: Device nnn (vbd) could not be connected.
Hotplug scripts not working".  The domains used vbd's backed by files.

Multiple instances of the hotplug "add" script were contending on its
lock file.  Some would get delayed so long that the xend DeviceController
would time out, and the domain would fail to start.  Also, the timeout
triggers a hotplug "remove" which could race with the "add", leaving
loopback devices allocated for non-existent domains.  The attached two patches
fix these problems.

Patch 1/2 adds a check that the vbd is still waiting for hotplug
(isn't being closed by xend) before setting up the loopback device.  It
also acquires the the lock file in the remove path to avoid racing with
the add.

Patch 2/2 speeds up finding a free loopback device and determining
if the vbd backing file is being shared with another domain in a compatible
way.  The speedup avoids the lock contention and also reduces the number of
xenstore operations.  In my test it reduced the time needed to start 30
domains by about 35%.

These apply to xen-unstable.

Signed-off-by: Gary Grebus <gary.grebus@xxxxxxxxxx>

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 0/2] Fix problems with vbd hotplug on Linux, Gary Grebus <=