From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: "Tim (Xen.org)" <tim@xen.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
xen-devel <xen-devel@lists.xen.org>,
Jan Beulich <JBeulich@suse.com>, Sheng Yang <sheng@yasker.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] xen: always set the sched clock as unstable
Date: Mon, 16 Apr 2012 11:17:59 -0400 [thread overview]
Message-ID: <20120416151759.GI1903@phenom.dumpdata.com> (raw)
In-Reply-To: <4F8C33E0.2080007@citrix.com>
On Mon, Apr 16, 2012 at 03:59:44PM +0100, David Vrabel wrote:
> On 16/04/12 12:32, Jan Beulich wrote:
> >>>> On 13.04.12 at 20:20, David Vrabel <david.vrabel@citrix.com> wrote:
> >> From: David Vrabel <david.vrabel@citrix.com>
> >>
> >> The sched clock was considered stable based on the capabilities of the
> >> underlying hardware. This does not make sense for Xen PV guests as:
In regards to PV dom0 is this still the case? Asking b/c your
patch will make dom0 be in the same category.
> >> a) the hardware TSC is not used directly as the clock source; and b)
> >> guests may migrate to hosts with different hardware capabilities.
> >>
> >> It is not clear to me whether the Xen clock source is supposed to be
> >> stable and whether it should be stable across migration. For a clock
I thought it was dependent on XEN_DOMCTL_settscinfo:
- whether it gets emulated, or the guest can do rdtsc or pvrdtsc?
Which I think is determined by some 'timer=X' option in the guest config?
> >> source to be stable it must be: a) monotonic; c) synchronized across
> >> CPUs; and c) constant rate.
>
> Tim, Thomas, can you comment on the above paragraph? Is it correct?
>
> >> There have also been reports of systems with apparently unstable
> >> clocks where clearing sched_clock_stable has fixed problems with
> >> migrated VMs hanging.
> >>
> >> So, always set the sched clock as unstable when using the Xen clock
> >> source.
> >>
> >> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> >> ---
> >> arch/x86/xen/time.c | 1 +
> >> 1 files changed, 1 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
> >> index 0296a95..8469b5a 100644
> >> --- a/arch/x86/xen/time.c
> >> +++ b/arch/x86/xen/time.c
> >> @@ -473,6 +473,7 @@ static void __init xen_time_init(void)
> >> do_settimeofday(&tp);
> >>
> >> setup_force_cpu_cap(X86_FEATURE_TSC);
> >> + sched_clock_stable = 0;
> >
> > This, unfortunately, is not sufficient afaict: If a CPU gets brought up
> > post-boot, the variable may need to be cleared again. Instead you
> > ought to call mark_tsc_unstable().
>
> Yeah, mark_tsc_unstable() is the right thing to do.
>
> David
next prev parent reply other threads:[~2012-04-16 15:17 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 18:20 [PATCH] xen: always set the sched clock as unstable David Vrabel
2012-04-13 18:31 ` Sheng Yang
2012-04-13 18:39 ` David Vrabel
2012-04-13 18:33 ` Sheng Yang
2012-04-16 11:32 ` Jan Beulich
[not found] ` <4F8C1F6D020000780007E11A@nat28.tlf.novell.com>
2012-04-16 14:59 ` David Vrabel
[not found] ` <4F8C33E0.2080007@citrix.com>
2012-04-16 15:16 ` Tim Deegan
2012-04-16 15:17 ` Konrad Rzeszutek Wilk [this message]
2012-04-16 16:20 ` Dan Magenheimer
2012-04-16 16:05 ` Dan Magenheimer
[not found] ` <049b7b93-fb37-4962-b272-d786e1dcfacb@default>
2012-04-16 16:14 ` Jan Beulich
2012-04-16 16:26 ` David Vrabel
2012-04-16 17:08 ` Tim Deegan
[not found] ` <4F8C619C020000780007E34E@nat28.tlf.novell.com>
2012-04-16 17:22 ` Dan Magenheimer
[not found] ` <84023b26-a682-44b5-990e-1635da6949ff@default>
2012-04-17 7:27 ` Jan Beulich
[not found] ` <4F8D3778020000780007E63A@nat28.tlf.novell.com>
2012-04-17 15:36 ` Dan Magenheimer
[not found] ` <4F8C4818.8070603@citrix.com>
2012-04-16 17:30 ` Dan Magenheimer
[not found] ` <8a78da52-26b2-42a2-80c7-c1ab8aee86eb@default>
2012-04-17 7:47 ` Jan Beulich
[not found] ` <4F8D3C4E020000780007E658@nat28.tlf.novell.com>
2012-04-17 15:42 ` Dan Magenheimer
[not found] ` <20120416170827.GE13111@ocelot.phlegethon.org>
2012-04-16 17:52 ` Dan Magenheimer
[not found] ` <3e05ae0e-afe4-4ed7-b839-39a343cc0d06@default>
2012-04-16 18:17 ` Tim Deegan
[not found] ` <20120416181744.GF13111@ocelot.phlegethon.org>
2012-04-16 23:01 ` Sheng Yang
[not found] ` <CA+2rt41pCFV1haMAHo63rY9kx88VgiV419pf8Y=u2cXrdmGOBA@mail.gmail.com>
2012-04-17 0:29 ` Dan Magenheimer
2012-04-17 8:19 ` Tim Deegan
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=20120416151759.GI1903@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=david.vrabel@citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sheng@yasker.org \
--cc=tglx@linutronix.de \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/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).