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, cpu hotplug: Synchronise vcpu state

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86, cpu hotplug: Synchronise vcpu state earlier during cpu offline.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 07 Apr 2010 02:20:15 -0700
Delivery-date: Wed, 07 Apr 2010 02:20: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 1270624140 -3600
# Node ID 7794f61c61f3b0c90e367a87b287850b31645742
# Parent  adce8bc43fcccf8730b1da962be60c457c51fa1b
x86, cpu hotplug: Synchronise vcpu state earlier during cpu offline.

Needs to happen before non-idle VCPU is fully descheduled after CPU is
removed from cpu_online_map. Else sync_vcpu_execstate() doesn't work
properly.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/domain.c  |    3 ++-
 xen/arch/x86/smpboot.c |   17 ++++++++++-------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff -r adce8bc43fcc -r 7794f61c61f3 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Tue Apr 06 07:16:47 2010 +0100
+++ b/xen/arch/x86/domain.c     Wed Apr 07 08:09:00 2010 +0100
@@ -1442,7 +1442,8 @@ void context_switch(struct vcpu *prev, s
 
     set_current(next);
 
-    if ( (per_cpu(curr_vcpu, cpu) == next) || is_idle_vcpu(next) )
+    if ( (per_cpu(curr_vcpu, cpu) == next) ||
+         (is_idle_vcpu(next) && cpu_online(cpu)) )
     {
         local_irq_enable();
     }
diff -r adce8bc43fcc -r 7794f61c61f3 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Tue Apr 06 07:16:47 2010 +0100
+++ b/xen/arch/x86/smpboot.c    Wed Apr 07 08:09:00 2010 +0100
@@ -997,17 +997,13 @@ static int __devinit do_boot_cpu(int api
        return boot_error;
 }
 
-static void idle_task_exit(void)
-{
-       /* Give up lazy state borrowed by this idle vcpu */
-       __sync_lazy_execstate();
-}
-
 void cpu_exit_clear(void)
 {
        int cpu = raw_smp_processor_id();
 
-       idle_task_exit();
+       /* Previous non-idle state should be synchronised already. */
+       if (__sync_lazy_execstate())
+               BUG();
 
        cpucount --;
        cpu_uninit();
@@ -1301,6 +1297,13 @@ int __cpu_disable(void)
        cpu_mcheck_disable();
 
        remove_siblinginfo(cpu);
+
+       /*
+        * If we are running the idle vcpu, sync last non-idle vcpu's state
+        * before changing cpu_online_map. If we are running non-idle vcpu,
+        * we will synchronously sync the state in context_switch() later.
+        */
+       __sync_lazy_execstate();
 
        /* It's now safe to remove this processor from the online map */
        cpu_clear(cpu, cpu_online_map);

_______________________________________________
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, cpu hotplug: Synchronise vcpu state earlier during cpu offline., Xen patchbot-unstable <=