From: Keir Fraser <keir.fraser@eu.citrix.com>
To: "Jiang, Yunhong" <yunhong.jiang@intel.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Jan Beulich <JBeulich@novell.com>
Subject: Re: [PATCH] [RFC] Fix a small window on CPU online/offline
Date: Fri, 02 Apr 2010 08:14:50 +0100 [thread overview]
Message-ID: <C7DB57FA.F810%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <789F9655DD1B8F43B48D77C5D30659731D614CD6@shsmsx501.ccr.corp.intel.com>
On 02/04/2010 04:31, "Jiang, Yunhong" <yunhong.jiang@intel.com> wrote:
> Have a short discussion with Kevin, maybe we can sync the state in
> cpu_disable_scheduler if current is idle, and then set a flag so that we will
> not sync again in context siwtch later. If the current is not idle, we can
> leave the context switch to do the sync for us. I will do more investigate to
> see how many changes are needed.
Hm, actually maybe that could work. You might not even need a flag in case
current is non-idle in cpu_disable_scheduler(). It might suffice to force
context_switch() to do full context switch synchronously when the CPU is
going offline (see appended patch). I was thinking there was a race as soon
as the cpu is cleared from cpu_online_map, but actually the problem occurs
only once the vcpu is descheduled, so if we can synchronously sync its state
before calling context_saved(), perhaps we are fine.
This could be a very small patch after all! :-)
-- Keir
--- a/xen/arch/x86/domain.c Thu Apr 01 09:55:27 2010 +0100
+++ b/xen/arch/x86/domain.c Fri Apr 02 08:12:14 2010 +0100
@@ -1442,7 +1442,8 @@
set_current(next);
- if ( (per_cpu(curr_vcpu, cpu) == next) || is_idle_vcpu(next) )
+ if ( (per_cpu(curr_vcpu, cpu) == next) ||
+ (is_idle_vcpu(next) && !cpu_is_offline(cpu)) )
{
local_irq_enable();
}
next prev parent reply other threads:[~2010-04-02 7:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-01 9:22 [PATCH] [RFC] Fix a small window on CPU online/offline Jiang, Yunhong
2010-04-01 10:25 ` Keir Fraser
2010-04-01 10:33 ` Keir Fraser
2010-04-02 3:31 ` Jiang, Yunhong
2010-04-02 7:14 ` Keir Fraser [this message]
2010-04-02 7:27 ` 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=C7DB57FA.F810%keir.fraser@eu.citrix.com \
--to=keir.fraser@eu.citrix.com \
--cc=JBeulich@novell.com \
--cc=kevin.tian@intel.com \
--cc=xen-devel@lists.xensource.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).