rpms/kernel/F-12 linux-2.6-xen-fix-is_disconnected_device-exists_disconnected_device.patch, NONE, 1.1 linux-2.6-xen-improvement-to-wait_for_devices.patch, NONE, 1.1 linux-2.6-xen-increase-device-connection-timeout.patch, NONE, 1.1 kernel.spec, 1.1836, 1.1837

Justin M. Forbes jforbes at fedoraproject.org
Mon Sep 28 19:22:06 UTC 2009


Author: jforbes

Update of /cvs/pkgs/rpms/kernel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6150

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-xen-fix-is_disconnected_device-exists_disconnected_device.patch 
	linux-2.6-xen-improvement-to-wait_for_devices.patch 
	linux-2.6-xen-increase-device-connection-timeout.patch 
Log Message:
Increase timeout for xen frontend devices to connect.

linux-2.6-xen-fix-is_disconnected_device-exists_disconnected_device.patch:
 xenbus_probe.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

--- NEW FILE linux-2.6-xen-fix-is_disconnected_device-exists_disconnected_device.patch ---
From: Paolo Bonzini <pbonzini at redhat.com>
Date: Wed, 8 Jul 2009 10:27:37 +0000 (+0200)
Subject: xen: fix is_disconnected_device/exists_disconnected_device
X-Git-Tag: xen-dom0-2.6.31-rc3~3^2~2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fjeremy%2Fxen.git;a=commitdiff_plain;h=8800a1de3df00fa994f72ad0d7c1eda9b5a0b514

xen: fix is_disconnected_device/exists_disconnected_device

The logic of is_disconnected_device/exists_disconnected_device is wrong
in that they are used to test whether a device is trying to connect (i.e.
connecting).  For this reason the patch fixes them to not consider a
Closing or Closed device to be connecting.  At the same time the patch
also renames the functions according to what they really do; you could
say a closed device is "disconnected" (the old name), but not "connecting"
(the new name).

This patch is a backport of changeset 909 from the Xenbits tree.

Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
---

diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index d42e25d..c543766 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -843,7 +843,7 @@ postcore_initcall(xenbus_probe_init);
 
 MODULE_LICENSE("GPL");
 
-static int is_disconnected_device(struct device *dev, void *data)
+static int is_device_connecting(struct device *dev, void *data)
 {
 	struct xenbus_device *xendev = to_xenbus_device(dev);
 	struct device_driver *drv = data;
@@ -861,14 +861,15 @@ static int is_disconnected_device(struct device *dev, void *data)
 		return 0;
 
 	xendrv = to_xenbus_driver(dev->driver);
-	return (xendev->state != XenbusStateConnected ||
-		(xendrv->is_ready && !xendrv->is_ready(xendev)));
+	return (xendev->state < XenbusStateConnected ||
+		(xendev->state == XenbusStateConnected &&
+		 xendrv->is_ready && !xendrv->is_ready(xendev)));
 }
 
-static int exists_disconnected_device(struct device_driver *drv)
+static int exists_connecting_device(struct device_driver *drv)
 {
 	return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv,
-				is_disconnected_device);
+				is_device_connecting);
 }
 
 static int print_device_status(struct device *dev, void *data)
@@ -918,7 +919,7 @@ static void wait_for_devices(struct xenbus_driver *xendrv)
 	if (!ready_to_wait_for_devices || !xen_domain())
 		return;
 
-	while (exists_disconnected_device(drv)) {
+	while (exists_connecting_device(drv)) {
 		if (time_after(jiffies, timeout))
 			break;
 		schedule_timeout_interruptible(HZ/10);

linux-2.6-xen-improvement-to-wait_for_devices.patch:
 xenbus_probe.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- NEW FILE linux-2.6-xen-improvement-to-wait_for_devices.patch ---
From: Paolo Bonzini <pbonzini at redhat.com>
Date: Wed, 8 Jul 2009 10:27:38 +0000 (+0200)
Subject: xen: improvement to wait_for_devices()
X-Git-Tag: xen-dom0-2.6.31-rc3~3^2~1
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fjeremy%2Fxen.git;a=commitdiff_plain;h=ed9ef1e71122628b50b0a526607509511b0d9135

xen: improvement to wait_for_devices()

When printing a warning about a timed-out device, print the
current state of both ends of the device connection (i.e., backend as
well as frontend).  This backports half of changeset 146 from the
Xenbits tree.

Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---

diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index c543766..3a867a5 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -885,10 +885,13 @@ static int print_device_status(struct device *dev, void *data)
 		/* Information only: is this too noisy? */
 		printk(KERN_INFO "XENBUS: Device with no driver: %s\n",
 		       xendev->nodename);
-	} else if (xendev->state != XenbusStateConnected) {
+	} else if (xendev->state < XenbusStateConnected) {
+		enum xenbus_state rstate = XenbusStateUnknown;
+		if (xendev->otherend)
+			rstate = xenbus_read_driver_state(xendev->otherend);
 		printk(KERN_WARNING "XENBUS: Timeout connecting "
-		       "to device: %s (state %d)\n",
-		       xendev->nodename, xendev->state);
+		       "to device: %s (local state %d, remote state %d)\n",
+		       xendev->nodename, xendev->state, rstate);
 	}
 
 	return 0;

linux-2.6-xen-increase-device-connection-timeout.patch:
 xenbus_probe.c |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

--- NEW FILE linux-2.6-xen-increase-device-connection-timeout.patch ---
From: Paolo Bonzini <pbonzini at redhat.com>
Date: Wed, 8 Jul 2009 10:27:39 +0000 (+0200)
Subject: xen: wait up to 5 minutes for device connetion
X-Git-Tag: xen-dom0-2.6.31-rc3~3^2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fjeremy%2Fxen.git;a=commitdiff_plain;h=11b84f69d36b518ff862a1bcd61ace7f8dac76b5;hp=ed9ef1e71122628b50b0a526607509511b0d9135

xen: wait up to 5 minutes for device connetion

Increases the device timeout from 10s to 5 minutes, giving the user a
visual indication during that time in case there are problems.  The patch
is a backport of changesets 144 and 150 in the Xenbits tree.

Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---

diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 3a867a5..4f69159 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -901,7 +901,7 @@ static int print_device_status(struct device *dev, void *data)
 static int ready_to_wait_for_devices;
 
 /*
- * On a 10 second timeout, wait for all devices currently configured.  We need
+ * On a 5-minute timeout, wait for all devices currently configured.  We need
  * to do this to guarantee that the filesystems and / or network devices
  * needed for boot are available, before we can allow the boot to proceed.
  *
@@ -916,18 +916,30 @@ static int ready_to_wait_for_devices;
  */
 static void wait_for_devices(struct xenbus_driver *xendrv)
 {
-	unsigned long timeout = jiffies + 10*HZ;
+	unsigned long start = jiffies;
 	struct device_driver *drv = xendrv ? &xendrv->driver : NULL;
+	unsigned int seconds_waited = 0;
 
 	if (!ready_to_wait_for_devices || !xen_domain())
 		return;
 
 	while (exists_connecting_device(drv)) {
-		if (time_after(jiffies, timeout))
-			break;
+		if (time_after(jiffies, start + (seconds_waited+5)*HZ)) {
+			if (!seconds_waited)
+				printk(KERN_WARNING "XENBUS: Waiting for "
+				       "devices to initialise: ");
+			seconds_waited += 5;
+			printk("%us...", 300 - seconds_waited);
+			if (seconds_waited == 300)
+				break;
+		}
+
 		schedule_timeout_interruptible(HZ/10);
 	}
 
+	if (seconds_waited)
+		printk("\n");
+
 	bus_for_each_dev(&xenbus_frontend.bus, NULL, drv,
 			 print_device_status);
 }


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/kernel.spec,v
retrieving revision 1.1836
retrieving revision 1.1837
diff -u -p -r1.1836 -r1.1837
--- kernel.spec	27 Sep 2009 19:57:56 -0000	1.1836
+++ kernel.spec	28 Sep 2009 19:22:04 -0000	1.1837
@@ -697,6 +697,9 @@ Patch1579: linux-2.6-virtio_blk-revert-Q
 Patch1580: linux-2.6-xen-check-efer-fix.patch
 Patch1581: linux-2.6-xen-spinlock-enable-interrupts-only-when-blocking.patch
 Patch1582: linux-2.6-xen-spinlock-stronger-barrier.patch
+Patch1583: linux-2.6-xen-fix-is_disconnected_device-exists_disconnected_device.patch
+Patch1584: linux-2.6-xen-improvement-to-wait_for_devices.patch
+Patch1585: linux-2.6-xen-increase-device-connection-timeout.patch
 
 # nouveau + drm fixes
 Patch1812: drm-next-8ef8678c8.patch
@@ -1356,6 +1359,9 @@ ApplyPatch linux-2.6-ksm-kvm.patch
 ApplyPatch linux-2.6-xen-stack-protector-fix.patch
 ApplyPatch linux-2.6-virtio_blk-revert-QUEUE_FLAG_VIRT-addition.patch
 ApplyPatch linux-2.6-xen-check-efer-fix.patch
+ApplyPatch linux-2.6-xen-fix-is_disconnected_device-exists_disconnected_device.patch
+ApplyPatch linux-2.6-xen-improvement-to-wait_for_devices.patch
+ApplyPatch linux-2.6-xen-increase-device-connection-timeout.patch
 
 # improve xen spinlock scalability
 ApplyPatch linux-2.6-xen-spinlock-enable-interrupts-only-when-blocking.patch
@@ -2063,6 +2069,9 @@ fi
 # and build.
 
 %changelog
+* Mon Sep 28 2009 Justin M. Forbes <jmforbes at redhat.com> 2.6.31.1-50
+- Increase timeout for xen frontend devices to connect.
+
 * Sat Sep 26 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.31.1-49
 - Add Xen spinlock patches to improve scalability.
 




More information about the scm-commits mailing list