WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86: freeze non-current vCPU-s of dom0 before entering S5
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 20 Nov 2008 13:42:30 +0000
Delivery-date: Thu, 20 Nov 2008 05:43:15 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86: freeze non-current vCPU-s of dom0 before entering S5, Jan Beulich <=