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

[Xen-changelog] [xen-unstable] Fix two issues for CPU online/offline.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1270737112 -3600
# Node ID c9e8369e49be7396eca444cfce27e6782e4aa248
# Parent  a33909be109cefb0aef251c7c7e48168ed05512a
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>
---
 xen/arch/x86/smpboot.c    |    6 ++----
 xen/common/sched_credit.c |    2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff -r a33909be109c -r c9e8369e49be xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Thu Apr 08 15:31:21 2010 +0100
+++ b/xen/arch/x86/smpboot.c    Thu Apr 08 15:31:52 2010 +0100
@@ -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 a33909be109c -r c9e8369e49be xen/common/sched_credit.c
--- a/xen/common/sched_credit.c Thu Apr 08 15:31:21 2010 +0100
+++ b/xen/common/sched_credit.c Thu Apr 08 15:31:52 2010 +0100
@@ -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);

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


 


Rackspace

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