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

[Xen-changelog] [xen stable-4.4] avoid crash when doing shutdown with active cpupools



commit 77e8f6f5e9652d0ea1ca868f58f7ea1cbbc9da33
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Mon Jul 28 14:53:22 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jul 28 14:53:22 2014 +0200

    avoid crash when doing shutdown with active cpupools
    
    When shutting down the machine while there are cpus in a cpupool other than
    Pool-0 a crash is triggered due to cpupool handling rejecting offlining the
    non-boot cpus in other cpupools.
    
    It is easy to detect this case and allow offlining those cpus.
    
    Reported-by: Stefan Bader <stefan.bader@xxxxxxxxxxxxx>
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Tested-by: Stefan Bader <stefan.bader@xxxxxxxxxxxxx>
    master commit: 05377dede434c746e6708f055858378d20f619db
    master date: 2014-07-23 18:03:19 +0200
---
 xen/common/cpupool.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 933de78..e46e930 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -471,12 +471,24 @@ static void cpupool_cpu_add(unsigned int cpu)
  */
 static int cpupool_cpu_remove(unsigned int cpu)
 {
-    int ret = 0;
+    int ret = -EBUSY;
+    struct cpupool **c;
 
     spin_lock(&cpupool_lock);
-    if ( !cpumask_test_cpu(cpu, cpupool0->cpu_valid))
-        ret = -EBUSY;
+    if ( cpumask_test_cpu(cpu, cpupool0->cpu_valid) )
+        ret = 0;
     else
+    {
+        for_each_cpupool(c)
+        {
+            if ( cpumask_test_cpu(cpu, (*c)->cpu_suspended ) )
+            {
+                ret = 0;
+                break;
+            }
+        }
+    }
+    if ( !ret )
         cpumask_set_cpu(cpu, &cpupool_locked_cpus);
     spin_unlock(&cpupool_lock);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.