[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.