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-devel

[Xen-devel] [PATCH] Fix two issues for CPU online/offline

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Fix two issues for CPU online/offline
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Thu, 8 Apr 2010 15:02:36 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 08 Apr 2010 00:04:29 -0700
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
Thread-index: AcrW6XhfbDYt4Z+dTtW8HrUx9njHGQ==
Thread-topic: [PATCH] Fix two issues for CPU online/offline
This patch fix two issues on CPU online/offline. The first is quite 
straightforward. For the second one, I'm not sure if we need change the 
csched_priv.idlers if we online/offline the CPUs, but at least the change in 
the patch is ok.

--jyh

Fix two issues for CPU online/offline.
Firstly, we should return if we fail to get spin lock in cpu_down.
Secondly, in credit scheduler, the idlers need be limited only to online map. 

Signed-off-by: Jiang, Yunhong <yunhong.jiang@xxxxxxxxx>

diff -r 28e5409e3fb3 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Wed Apr 07 16:22:05 2010 +0100
+++ b/xen/arch/x86/smpboot.c    Thu Apr 08 13:51:42 2010 +0800
@@ -1343,10 +1343,8 @@ int cpu_down(unsigned int cpu)
        int err = 0;
 
        /* spin_trylock() avoids deadlock with stop_machine_run(). */
-       if (!spin_trylock(&cpu_add_remove_lock)) {
-               err = -EBUSY;
-               goto out;
-       }
+       if (!spin_trylock(&cpu_add_remove_lock))
+               return -EBUSY;
 
        if (num_online_cpus() == 1) {
                err = -EBUSY;
diff -r 28e5409e3fb3 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c Wed Apr 07 16:22:05 2010 +0100
+++ b/xen/common/sched_credit.c Thu Apr 08 13:51:42 2010 +0800
@@ -428,7 +428,7 @@ _csched_cpu_pick(struct vcpu *vc, bool_t
      * like run two VCPUs on co-hyperthreads while there are idle cores
      * or sockets.
      */
-    idlers = csched_priv.idlers;
+    cpus_and(idlers, cpu_online_map, csched_priv.idlers);
     cpu_set(cpu, idlers);
     cpus_and(cpus, cpus, idlers);
     cpu_clear(cpu, cpus);


Attachment: cpu_online.patch
Description: cpu_online.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix two issues for CPU online/offline, Jiang, Yunhong <=