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-4.1-testing] x86: On CPU offline, fix master waitin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.1-testing] x86: On CPU offline, fix master waiting for slave to be fully dead.
From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
Date: Sun, 06 Mar 2011 17:50:12 +0000
Delivery-date: Sun, 06 Mar 2011 09:51:08 -0800
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@xxxxxxx>
# Date 1299325062 0
# Node ID 9d4cdf7d70b9ef9e2907954e42600a2eed71947d
# Parent  51e74954aa8fa9d2777e02b8490e4dd277098149
x86: On CPU offline, fix master waiting for slave to be fully dead.

On two back-to-back CPU offline operations, on second offline the
cpu_state var will be CPU_STATE_DEAD from the first offline. Hence
__cpu_die() will incorrectly not wait for the second slave to fully
die and set cpu_state itself.

The fix is to set cpu_state to a new value, CPU_STATE_DYING, earlier
during CPU offline, before __cpu_die() starts to execute.

Original diagnosis and patch by Liu, Jinsong <jinsong.liu@xxxxxxxxx>

Signed-off-by: Keir Fraser <keir@xxxxxxx>
xen-unstable changeset:   22975:d3d29df8f082
xen-unstable date:        Sat Mar 05 11:34:41 2011 +0000
---


diff -r 51e74954aa8f -r 9d4cdf7d70b9 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Sat Mar 05 11:35:29 2011 +0000
+++ b/xen/arch/x86/smpboot.c    Sat Mar 05 11:37:42 2011 +0000
@@ -74,7 +74,8 @@
 
 static int cpu_error;
 static enum cpu_state {
-    CPU_STATE_DEAD = 0, /* slave -> master: I am completely dead */
+    CPU_STATE_DYING,    /* slave -> master: I am dying */
+    CPU_STATE_DEAD,     /* slave -> master: I am completely dead */
     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 */
@@ -834,6 +835,8 @@
     extern void fixup_irqs(void);
     int cpu = smp_processor_id();
 
+    set_cpu_state(CPU_STATE_DYING);
+
     local_irq_disable();
     clear_local_APIC();
     /* Allow any queued timer interrupts to get serviced */
@@ -861,6 +864,7 @@
 
     while ( cpu_state != CPU_STATE_DEAD )
     {
+        BUG_ON(cpu_state != CPU_STATE_DYING);
         mdelay(100);
         cpu_relax();
         process_pending_softirqs();

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.1-testing] x86: On CPU offline, fix master waiting for slave to be fully dead., Xen patchbot-4 . 1-testing <=