xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix cpu offline bug
@ 2011-03-04 10:22 Liu, Jinsong
  2011-03-04 10:49 ` Keir Fraser
  2011-03-05 11:40 ` Keir Fraser
  0 siblings, 2 replies; 9+ messages in thread
From: Liu, Jinsong @ 2011-03-04 10:22 UTC (permalink / raw)
  To: Keir Fraser, xen-devel@lists.xensource.com
  Cc: Jiang, Yunhong, keir@xen.org, Li, Xin

[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]

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@intel.com>

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 #2: cpuoffline_fix_1.bug --]
[-- Type: application/octet-stream, Size: 1251 bytes --]

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@intel.com>

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 #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-03-08 15:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04 10:22 [PATCH] Fix cpu offline bug Liu, Jinsong
2011-03-04 10:49 ` Keir Fraser
2011-03-08  8:52   ` Jan Beulich
2011-03-08  9:47     ` Liu, Jinsong
2011-03-08 10:14       ` Jan Beulich
2011-03-08 15:36         ` Keir Fraser
2011-03-05 11:40 ` Keir Fraser
2011-03-05 15:10   ` Liu, Jinsong
2011-03-05 15:57     ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).