WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 0 of 5] PV on HVM Xen

To: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 0 of 5] PV on HVM Xen
From: Sheng Yang <sheng@xxxxxxxxxxxxxxx>
Date: Tue, 16 Mar 2010 14:09:26 +0800
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Eddie Dong <eddie.dong@xxxxxxxxx>, frank.van.der.linden@xxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Mon, 15 Mar 2010 23:10:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <bb4d3eaa-dcf1-4812-a4d9-63c454c4105c@default>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Intel Opensource Technology Center
References: <alpine.DEB.2.00.1003101457100.28412@kaball-desktop> <alpine.DEB.2.00.1003151128010.28944@kaball-desktop 4B9EBE03.4080105@xxxxxxxx> <bb4d3eaa-dcf1-4812-a4d9-63c454c4105c@default>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; )
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@xxxxxxxx]
> > Sent: Monday, March 15, 2010 5:09 PM
> > To: Stefano Stabellini
> > Cc: xen-devel@xxxxxxxxxxxxxxxxxxx; 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@xxxxxxxxxxxxxxxxxxx
> > http://lists.xensource.com/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel