From: "Jan Beulich" <jbeulich@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] x86: freeze non-current vCPU-s of dom0 before entering S5
Date: Thu, 20 Nov 2008 13:42:30 +0000 [thread overview]
Message-ID: <49257756.76E4.0078.0@novell.com> (raw)
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@novell.com>
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)
reply other threads:[~2008-11-20 13:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49257756.76E4.0078.0@novell.com \
--to=jbeulich@novell.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.