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] Fix cpu offline bug

To: Keir Fraser <keir.xen@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Fix cpu offline bug
From: "Liu, Jinsong" <jinsong.liu@xxxxxxxxx>
Date: Fri, 4 Mar 2011 18:22:28 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>, "keir@xxxxxxx" <keir@xxxxxxx>, "Li, Xin" <xin.li@xxxxxxxxx>
Delivery-date: Fri, 04 Mar 2011 02:24:01 -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
Thread-index: AcvaVg/u0QwvoHZBRPSNM5hGIfEKXQ==
Thread-topic: [PATCH] Fix cpu offline bug
Fix cpu offline bug

At current xen, when cpu offline, cpu0 will wait the 1st cpu offline;
However, if offline 2nd, 3rd, ... cpu, cpu0 will not wait it.
This patch is used to fix the bug.

Signed-off-by: Liu, Jinsong <jinsong.liu@xxxxxxxxx>

diff -r d1631540bcc4 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Tue Jan 18 17:23:24 2011 +0000
+++ b/xen/arch/x86/smpboot.c    Sat Feb 12 03:48:09 2011 +0800
@@ -78,7 +78,8 @@ static enum cpu_state {
     CPU_STATE_INIT,     /* master -> slave: Early bringup phase 1 */
     CPU_STATE_CALLOUT,  /* master -> slave: Early bringup phase 2 */
     CPU_STATE_CALLIN,   /* slave -> master: Completed phase 2 */
-    CPU_STATE_ONLINE    /* master -> slave: Go fully online now. */
+    CPU_STATE_ONLINE,   /* master -> slave: Go fully online now. */
+    CPU_STATE_STAY      /* after slave dead, global cpu_state stay here */
 } cpu_state;
 #define set_cpu_state(state) do { mb(); cpu_state = (state); } while (0)
 
@@ -867,6 +868,8 @@ void __cpu_die(unsigned int cpu)
         if ( (++i % 10) == 0 )
             printk(KERN_ERR "CPU %u still not dead...\n", cpu);
     }
+
+    set_cpu_state(CPU_STATE_STAY);
 }
 
 int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm)

Attachment: cpuoffline_fix_1.bug
Description: cpuoffline_fix_1.bug

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