From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Sheng Yang <sheng@linux.intel.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
xen-devel@lists.xensource.com,
Stabellini <stefano.stabellini@eu.citrix.com>,
Eddie Dong <eddie.dong@intel.com>,
Stefano, frank.van.der.linden@oracle.com
Subject: RE: [PATCH 0 of 5] PV on HVM Xen
Date: Tue, 16 Mar 2010 09:46:35 -0700 (PDT) [thread overview]
Message-ID: <28ba8892-0f90-4613-91f0-a60abd09b1bd@default> (raw)
In-Reply-To: <201003161409.26579.sheng@linux.intel.com>
Hi Sheng --
A few comments:
- with default tsc_mode, PV handles migration fine
and I think HVM does also. But that is because,
in many situations in 4.0, rdtsc is trapped/emulated
- pvclock is not always the best way to handle timer
(tsc as the clocksource is better in some cases...
ask VMware)
- because KVM does something doesn't mean it is the
best way to do it ;-)
- pvclock doesn't eliminate timer_mode cases...
timer_mode is required for legacy guest OS's
- in case there is any confusion, tsc_mode and timer_mode
are different options for very different problems
There are many many different cases to consider across
different processors, different guest OS's, different
migration scenarios. Have you measured any of them
(using 4.0) or are you using old data or simply making
the assumption that the existing pvclock mechanism is
always the fastest?
I am very supportive of virtualization-aware guest OS's,
but let's get some measurements.
Dan
> -----Original Message-----
> From: Sheng Yang [mailto:sheng@linux.intel.com]
> Sent: Tuesday, March 16, 2010 12:09 AM
> To: Dan Magenheimer
> Cc: Jeremy Fitzhardinge; xen-devel@lists.xensource.com; Eddie Dong;
> Frank Van Der Linden; Stefano Stabellini
> Subject: Re: [Xen-devel] [PATCH 0 of 5] PV on HVM Xen
>
> On Tuesday 16 March 2010 08:32:22 Dan Magenheimer wrote:
> > Sorry I've fallen hopelessly behind on this thread (rope? :-)
> > so apologies if this has already been addressed:
> >
> > If the host and guest need to share the same tsc to work
> > properly, and there are apps in the guest that assume a
> > monotonically increasing TSC (or even "approximately monotonically
> > increasing", e.g. can filter out reasonably small differences),
> > and the VM migrates from a physical machine that's been running
> > a long time to a recently booted physical machine, what
> > happens to the app? (Answer: Prior to 4.0, or with tsc_mode==2
> > in 4.0, the app fails.)
>
> I haven't checked the live migration issue. But how does PV guest or
> kvmclock
> deal with it? The same should works here. Even we may got some trouble
> in some
> condition, we can still fall back to normal clocksource without any
> loss(though we didn't want this thing always happen).
> >
> > TSC emulation addresses this issue (which is why it is effectively
> > the default in Xen 4.0**) but has the side effect that the TSC reads
> > required for the pvclock algorithm are trapped/emulated. In this
> > case, pvclock may not be much faster than alternative
> > clocksource implementations.
>
> The hardware emulation is always not the best solution to address timer
> issue.
> For example, now we have 3 kinds of different timer mode, and we have
> to let
> user to determine which one is correct. And hope we won't need more
> timer mode
> in the future. PV is always the best way to handle timer. Take a look
> at KVM,
> they don't use much PV, but kvmclock is a must.
>
> > > Sheng/Stefano, have you actually measured pvclock recently
> > and compared it to other alternatives? I'm wondering how
> > much of this discussion is moot.
>
> If live migration is a issue now, we can address it. But hardware
> emulation is
> even a issue for non-LM case - guest need to know the timer mode, which
> is
> impossible to address. It's surely not the preferred method for VM if a
> PV way
> is available(of course, and works well).
>
> --
> regards
> Yang, Sheng
>
>
> > Dan
> >
> > P.S. Note that TSC emulation in many cases behaves differently
> > before and after migration, specifically on modern processors
> > depending on the clock frequency of the source/destination
> > machines, so please ensure post-migration is measured as this
> > will be the common case in many virtualized data centers.
> >
> > ** see xen-unstable.hg/docs/misc/tscmode.txt
> >
> > > -----Original Message-----
> > > From: Jeremy Fitzhardinge [mailto:jeremy@goop.org]
> > > Sent: Monday, March 15, 2010 5:09 PM
> > > To: Stefano Stabellini
> > > Cc: xen-devel@lists.xensource.com; Sheng Yang
> > > Subject: Re: [Xen-devel] [PATCH 0 of 5] PV on HVM Xen
> > >
> > > On 03/15/2010 05:28 AM, Stefano Stabellini wrote:
> > > > I like your pv clocksource implementation.
> > > > The only reason why I would defer the patch is that I don't
> > >
> > > particularly
> > >
> > > > like the "enable_pv" hypercall, so I would try to get away
> without
> > >
> > > it,
> > >
> > > > resetting the tsc offset automatically when enabling the
> VIRQ_TIMER
> > >
> > > on
> > >
> > > > an HVM domain.
> > >
> > > Ah, so the issue is that if we're using the pvclock, the host and
> guest
> > > need to share the same tsc, so we can't deal with any kind of tsc
> > > offset?
> > >
> > > In that case, I'd prefer to have an explicit "set/remove tsc
> offset"
> > > vcpu op rather than making it the implicit side-effect of anything
> > > else. In particular, since clock sources and event sources are
> > > completely distinct, making tsc offset (a clock source thing)
> affected
> > > VIRQ_TIMER (and event source thing) seems like a particularly poor
> > > idea.
> > >
> > > That, or make the pvclock structure the HVM vcpu sees have timing
> > > parameters which already incorporate the tsc offset. We've already
> > > demonstrated that there's no need to have the time info in the real
> > > shared memory between Xen and the domain (it can be updated via
> copy
> > > when needed).
> > >
> > > J
> > >
> > > _______________________________________________
> > > Xen-devel mailing list
> > > Xen-devel@lists.xensource.com
> > > http://lists.xensource.com/xen-devel
> >
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2010-03-16 16:46 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-10 15:46 [PATCH 0 of 5] PV on HVM Xen Stefano Stabellini
2010-03-10 17:33 ` [Xen-devel] " Pasi Kärkkäinen
2010-03-10 17:55 ` Stefano Stabellini
2010-03-10 19:45 ` Jeremy Fitzhardinge
2010-03-12 3:23 ` Sheng Yang
2010-03-12 10:42 ` [Xen-devel] " Stefano Stabellini
2010-03-12 16:00 ` Stefano Stabellini
2010-03-15 4:05 ` Sheng Yang
2010-03-15 8:29 ` Sheng Yang
2010-03-15 12:22 ` Stefano Stabellini
2010-03-17 9:38 ` Sheng Yang
2010-03-17 14:18 ` Konrad Rzeszutek Wilk
2010-03-17 15:21 ` Stefano Stabellini
2010-03-17 16:13 ` Jeremy Fitzhardinge
2010-03-18 1:30 ` Sheng Yang
2010-03-19 20:38 ` Jeremy Fitzhardinge
2010-03-22 6:26 ` MSI proposal and work transfer...(was: Re: [PATCH 0 of 5] PV on HVM Xen) Sheng Yang
2010-03-23 20:47 ` Jeremy Fitzhardinge
2010-03-24 8:19 ` Sheng Yang
2010-03-23 23:16 ` Stefano Stabellini
2010-03-24 8:25 ` Sheng Yang
2010-03-18 2:19 ` [PATCH 0 of 5] PV on HVM Xen Sheng Yang
2010-03-18 16:42 ` Jeremy Fitzhardinge
2010-03-17 16:13 ` Jeremy Fitzhardinge
2010-03-15 12:28 ` Stefano Stabellini
2010-03-15 23:08 ` Jeremy Fitzhardinge
2010-03-15 23:24 ` Frank van der Linden
2010-03-16 0:32 ` Dan Magenheimer
2010-03-16 6:09 ` Sheng Yang
2010-03-16 16:46 ` Dan Magenheimer [this message]
2010-03-16 11:07 ` Stefano Stabellini
2010-03-16 17:23 ` Jeremy Fitzhardinge
2010-03-16 17:32 ` Stefano Stabellini
2010-03-16 17:41 ` Jeremy Fitzhardinge
2010-03-16 18:06 ` Stefano Stabellini
2010-03-16 18:26 ` Jeremy Fitzhardinge
2010-03-16 18:37 ` Stefano Stabellini
2010-03-17 8:51 ` Sheng Yang
2010-03-17 9:18 ` Sheng Yang
2010-03-17 15:17 ` Stefano Stabellini
2010-03-17 18:20 ` Ian Campbell
2010-03-18 1:42 ` Sheng Yang
2010-03-18 1:35 ` Sheng Yang
2010-03-18 14:22 ` Stefano Stabellini
2010-03-18 16:50 ` Jeremy Fitzhardinge
2010-03-18 17:30 ` Jeremy Fitzhardinge
2010-03-12 21:53 ` [Xen-devel] " Jeremy Fitzhardinge
-- strict thread matches above, loose matches on Subject: below --
2010-03-12 11:44 Boris Derzhavets
2010-03-12 11:59 ` Stefano Stabellini
2010-03-12 15:01 ` Boris Derzhavets
2010-03-12 15:08 ` Stefano Stabellini
2010-03-12 15:09 ` Boris Derzhavets
2010-03-12 20:10 ` Jeremy Fitzhardinge
2010-03-12 21:14 ` Boris Derzhavets
2010-03-12 21:22 ` Jeremy Fitzhardinge
2010-03-12 21:28 ` Boris Derzhavets
2010-03-12 21:25 ` Boris Derzhavets
2010-03-12 21:29 ` Jeremy Fitzhardinge
2010-03-12 22:08 ` Boris Derzhavets
2010-03-12 22:11 ` Jeremy Fitzhardinge
2010-03-12 22:13 ` Boris Derzhavets
2010-03-12 22:22 ` Jeremy Fitzhardinge
2010-03-15 15:53 ` Stefano Stabellini
2010-03-15 16:02 ` Boris Derzhavets
2010-03-15 17:27 ` Stefano Stabellini
2010-03-15 17:49 ` Boris Derzhavets
2010-03-15 18:01 ` Stefano Stabellini
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=28ba8892-0f90-4613-91f0-a60abd09b1bd@default \
--to=dan.magenheimer@oracle.com \
--cc=eddie.dong@intel.com \
--cc=frank.van.der.linden@oracle.com \
--cc=jeremy@goop.org \
--cc=sheng@linux.intel.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.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).