xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: "Jiang, Yunhong" <yunhong.jiang@intel.com>, "Li, Xin" <xin.li@intel.com>
Subject: Re: [PATCH] Fix cpu offline bug
Date: Fri, 04 Mar 2011 10:49:05 +0000	[thread overview]
Message-ID: <C9967421.14234%keir.xen@gmail.com> (raw)
In-Reply-To: <BC00F5384FCFC9499AF06F92E8B78A9E1FA4F5A806@shsmsx502.ccr.corp.intel.com>

Good fix of a nasty bug! I think I will refactor this a bit and do it
slightly differently, but the (simple) principle will of course be the same.

 Thanks,
 Keir

On 04/03/2011 10:22, "Liu, Jinsong" <jinsong.liu@intel.com> wrote:

> 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)

  reply	other threads:[~2011-03-04 10:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-04 10:22 [PATCH] Fix cpu offline bug Liu, Jinsong
2011-03-04 10:49 ` Keir Fraser [this message]
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

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=C9967421.14234%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=jinsong.liu@intel.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xin.li@intel.com \
    --cc=yunhong.jiang@intel.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 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).