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

[Xen-changelog] [xen stable-4.4] cpupool: assigning a CPU to a pool can fail



commit 5d660a98a801e12c779344cc3afcf17cba95df5f
Author:     Dario Faggioli <dario.faggioli@xxxxxxxxxx>
AuthorDate: Thu Jun 18 09:17:16 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jun 18 09:17:16 2015 +0200

    cpupool: assigning a CPU to a pool can fail
    
    which means such an event must be handled at the call sites
    of cpupool_assign_cpu_locked(), and the error, if occurring,
    properly propagated.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
    master commit: d415a81b2245ac4b27f8cbf4e314449ef275333a
    master date: 2015-05-07 15:15:53 +0200
---
 xen/common/cpupool.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 2c283b9..dd35fdc 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -457,8 +457,10 @@ void cpupool_rm_domain(struct domain *d)
  * unless we are resuming from S3, in which case we put the cpu back
  * in the cpupool it was in prior to suspend.
  */
-static void cpupool_cpu_add(unsigned int cpu)
+static int cpupool_cpu_add(unsigned int cpu)
 {
+    int ret = -EINVAL;
+
     spin_lock(&cpupool_lock);
     cpumask_clear_cpu(cpu, &cpupool_locked_cpus);
     cpumask_set_cpu(cpu, &cpupool_free_cpus);
@@ -471,15 +473,20 @@ static void cpupool_cpu_add(unsigned int cpu)
         {
             if ( cpumask_test_cpu(cpu, (*c)->cpu_suspended ) )
             {
-                cpupool_assign_cpu_locked(*c, cpu);
+                ret = cpupool_assign_cpu_locked(*c, cpu);
+                if ( ret )
+                    goto out;
                 cpumask_clear_cpu(cpu, (*c)->cpu_suspended);
             }
         }
     }
 
     if ( cpumask_test_cpu(cpu, &cpupool_free_cpus) )
-        cpupool_assign_cpu_locked(cpupool0, cpu);
+        ret = cpupool_assign_cpu_locked(cpupool0, cpu);
+ out:
     spin_unlock(&cpupool_lock);
+
+    return ret;
 }
 
 /*
@@ -703,7 +710,7 @@ static int cpu_callback(
     {
     case CPU_DOWN_FAILED:
     case CPU_ONLINE:
-        cpupool_cpu_add(cpu);
+        rc = cpupool_cpu_add(cpu);
         break;
     case CPU_DOWN_PREPARE:
         rc = cpupool_cpu_remove(cpu);
--
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®.