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-changelog

[Xen-changelog] [xen-unstable] x86: Simplify freeze_domains() and thaw_d

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Simplify freeze_domains() and thaw_domains(). Since they now
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Apr 2010 18:50:25 -0700
Delivery-date: Mon, 19 Apr 2010 18:52:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1271673289 -3600
# Node ID 652e40d4dd8864a16084a1ff634d95f4a7260f20
# Parent  6ed67e488830f81e11d7b6d0c011a0bc5c176929
x86: Simplify freeze_domains() and thaw_domains(). Since they now
run in idle-vcpu context, no care needs to be taken about pausing
'current'.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/acpi/power.c |   53 +++++++++++++---------------------------------
 1 files changed, 16 insertions(+), 37 deletions(-)

diff -r 6ed67e488830 -r 652e40d4dd88 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c Mon Apr 19 11:30:51 2010 +0100
+++ b/xen/arch/x86/acpi/power.c Mon Apr 19 11:34:49 2010 +0100
@@ -77,46 +77,25 @@ static void freeze_domains(void)
 static void freeze_domains(void)
 {
     struct domain *d;
-    struct vcpu *v;
+
+    rcu_read_lock(&domlist_read_lock);
+    /*
+     * Note that we iterate in order of domain-id. Hence we will pause dom0
+     * first which is required for correctness (as only dom0 can add domains to
+     * the domain list). Otherwise we could miss concurrently-created domains.
+     */
+    for_each_domain ( d )
+        domain_pause(d);
+    rcu_read_unlock(&domlist_read_lock);
+}
+
+static void thaw_domains(void)
+{
+    struct domain *d;
 
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
-    {
-        switch ( d->domain_id )
-        {
-        case 0:
-            for_each_vcpu ( d, v )
-                if ( v != current )
-                    vcpu_pause(v);
-            break;
-        default:
-            domain_pause(d);
-            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 )
-    {
-        switch ( d->domain_id )
-        {
-        case 0:
-            for_each_vcpu ( d, v )
-                if ( v != current )
-                    vcpu_unpause(v);
-            break;
-        default:
-            domain_unpause(d);
-            break;
-        }
-    }
+        domain_unpause(d);
     rcu_read_unlock(&domlist_read_lock);
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: Simplify freeze_domains() and thaw_domains(). Since they now, Xen patchbot-unstable <=