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: Sat, 05 Mar 2011 15:57:01 +0000 [thread overview]
Message-ID: <C9980DCD.142BB%keir.xen@gmail.com> (raw)
In-Reply-To: <BC00F5384FCFC9499AF06F92E8B78A9E1FA4F5A909@shsmsx502.ccr.corp.intel.com>
Urk, good point!
Thanks,
Keir
On 05/03/2011 15:10, "Liu, Jinsong" <jinsong.liu@intel.com> wrote:
> Keir,
>
> Thanks for comments and update!
> However, I think we still need update it a little :)
>
> =============================
> Fix cpu offline bug
>
> Remove BUG_ON since it's of some risk, considering the small time window:
> cpu0 read (cpu_state) --> offlining cpu write (cpu_state) --> cpu0 read
> (cpu_state)
>
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
>
> diff -r 1ecb840bea17 xen/arch/x86/smpboot.c
> --- a/xen/arch/x86/smpboot.c Sat Mar 05 23:30:29 2022 +0800
> +++ b/xen/arch/x86/smpboot.c Sun Mar 06 01:21:34 2022 +0800
> @@ -864,7 +864,6 @@ void __cpu_die(unsigned int cpu)
>
> while ( cpu_state != CPU_STATE_DEAD )
> {
> - BUG_ON(cpu_state != CPU_STATE_DYING);
> mdelay(100);
> cpu_relax();
> process_pending_softirqs();
> =============================
>
> Thanks,
> Jinsong
>
>
>
> Keir Fraser wrote:
>> 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.
>>
>> Alternative fix applied tio unstable and 4.1-testing. The fix below
>> doesn't account for the fact that cpu_state can also ==
>> CPU_STATE_DEAD after an (unsuccessful) CPU online operation.
>>
>> -- Keir
>>
>>> 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)
>
prev parent reply other threads:[~2011-03-05 15:57 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
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 message]
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=C9980DCD.142BB%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).