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

[Xen-devel] [PATCH] x86: freeze non-current vCPU-s of dom0 before entering S5



Also excluding the idle domain from the domains being frozen.

This seems to be particularly important for 3.2 and 3.3, -unstable should
be fine since the non-idle-vCPU-s are being migrated away from the pCPU-s
being torn down.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2008-11-20/xen/arch/x86/acpi/power.c
===================================================================
--- 2008-11-20.orig/xen/arch/x86/acpi/power.c   2008-11-19 17:37:33.000000000 
+0100
+++ 2008-11-20/xen/arch/x86/acpi/power.c        2008-11-20 10:07:54.000000000 
+0100
@@ -77,19 +77,51 @@ static void device_power_up(void)
 static void freeze_domains(void)
 {
     struct domain *d;
+    struct vcpu *v;
 
+    rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
-        if ( d->domain_id != 0 )
+    {
+        switch ( d->domain_id )
+        {
+        default:
             domain_pause(d);
+            break;
+        case 0:
+            for_each_vcpu ( d, v )
+                if ( v != current )
+                    vcpu_pause(v);
+            break;
+        case IDLE_DOMAIN_ID:
+            break;
+        }
+    }
+    rcu_read_unlock(&domlist_read_lock);
 }
 
 static void thaw_domains(void)
 {
     struct domain *d;
+    struct vcpu *v;
 
+    rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
-        if ( d->domain_id != 0 )
+    {
+        switch ( d->domain_id )
+        {
+        default:
             domain_unpause(d);
+            break;
+        case 0:
+            for_each_vcpu ( d, v )
+                if ( v != current )
+                    vcpu_unpause(v);
+            break;
+        case IDLE_DOMAIN_ID:
+            break;
+        }
+    }
+    rcu_read_unlock(&domlist_read_lock);
 }
 
 static void acpi_sleep_prepare(u32 state)




_______________________________________________
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®.