WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] tools/misc/xen-hptool: Silently retry on

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools/misc/xen-hptool: Silently retry on CPU hotplug EBUSY failure.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Jan 2011 08:00:30 -0800
Delivery-date: Mon, 17 Jan 2011 08:21:02 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1294998802 0
# Node ID c3b5924919e38090339be3bb1fa2d9aa7762eddd
# Parent  ff97273750b8381062d81d1b9c72b4ccc43011c9
tools/misc/xen-hptool: Silently retry on CPU hotplug EBUSY failure.

EBUSY is a legitimate soft failure, due to inability to acquire a
lock, or because RCU work has not been done since a CPU was last
offlined.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---
 tools/misc/xen-hptool.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff -r ff97273750b8 -r c3b5924919e3 tools/misc/xen-hptool.c
--- a/tools/misc/xen-hptool.c   Fri Jan 14 09:52:02 2011 +0000
+++ b/tools/misc/xen-hptool.c   Fri Jan 14 09:53:22 2011 +0000
@@ -2,6 +2,7 @@
 #include <xc_private.h>
 #include <xc_core.h>
 #include <errno.h>
+#include <unistd.h>
 
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
@@ -241,6 +242,20 @@ static int hp_mem_offline_func(int argc,
     return ret;
 }
 
+static int exec_cpu_hp_fn(int (*hp_fn)(xc_interface *, int), int cpu)
+{
+    int ret;
+
+    for ( ; ; )
+    {
+        ret = (*hp_fn)(xch, cpu);
+        if ( (ret >= 0) || (errno != EBUSY) )
+            break;
+        usleep(100000); /* 100ms */
+    }
+
+    return ret;
+}
 
 static int hp_cpu_online_func(int argc, char *argv[])
 {
@@ -254,7 +269,7 @@ static int hp_cpu_online_func(int argc, 
 
     cpu = atoi(argv[0]);
     printf("Prepare to online CPU %d\n", cpu);
-    ret = xc_cpu_online(xch, cpu);
+    ret = exec_cpu_hp_fn(xc_cpu_online, cpu);
     if (ret < 0)
         fprintf(stderr, "CPU %d online failed (error %d: %s)\n",
                 cpu, errno, strerror(errno));
@@ -275,7 +290,7 @@ static int hp_cpu_offline_func(int argc,
     }
     cpu = atoi(argv[0]);
     printf("Prepare to offline CPU %d\n", cpu);
-    ret = xc_cpu_offline(xch, cpu);
+    ret = exec_cpu_hp_fn(xc_cpu_offline, cpu);
     if (ret < 0)
         fprintf(stderr, "CPU %d offline failed (error %d: %s)\n",
                 cpu, errno, strerror(errno));

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools/misc/xen-hptool: Silently retry on CPU hotplug EBUSY failure., Xen patchbot-unstable <=