All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Dong, Eddie" <eddie.dong@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: "Yang, Xiaowei" <xiaowei.yang@intel.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: RE: TSC virtualization across different host frequency platform migration
Date: Thu, 23 Apr 2009 14:15:11 +0800	[thread overview]
Message-ID: <0A882F4D99BBF6449D58E61AAFD7EDD6136777F7@pdsmsx502.ccr.corp.intel.com> (raw)
In-Reply-To: <b1c379e5-d984-4ed2-9e1d-76639c9588b9@default>

[-- Attachment #1: Type: text/plain, Size: 3776 bytes --]

>From: Dan Magenheimer [mailto:dan.magenheimer@oracle.com] 
>Sent: 2009年4月23日 11:40
>
>OK, I think I understand, but I think you are
>solving a very limited problem ("make sure that
>a user/program that requests time-of-day gets
>an answer which is close to accurate") but
>not solving the broader class of time problems,
>and you may be making them worse.  If your solution
>is implemented and the OS or an application reads tsc,
>the values obtained will be monotonically increasing
>but will have large gaps, correct?

that's always the case even w/o migration, since VM can be
preempted at any time. 

>
>If software-emulated tsc reads is really 10% loss
>in system performance, I agree that this might be
>the lesser of two evils.  But I don't believe the
>10%.

That's really application specific, depending on the frequency
of gettimeofday, e.g. in some database transation to stamp
each record fastly. I had no exact data though. One of my 
colleagues (Xiaowei Yang) once solved one severe performance 
downgrade issue (orders of magnitude, >10%), when guest
is observed falling back to use vHPET instead of TSC. The
reason for fallback is not important here, but that actually inspires
us to pay more attention here.

Thanks,
Kevin

>
>> -----Original Message-----
>> From: Tian, Kevin [mailto:kevin.tian@intel.com]
>> Sent: Wednesday, April 22, 2009 9:21 PM
>> To: Dong, Eddie; Dan Magenheimer; xen-devel@lists.xensource.com
>> Cc: Keir Fraser; Zhang, Xiantao
>> Subject: RE: [Xen-devel] TSC virtualization across different
>> host frequency platform migration
>>
>>
>> >From: Dong, Eddie
>> >Sent: 2009年4月23日 9:29
>> >
>> >Dan Magenheimer wrote:
>> >> Hi Eddie/Kevin --
>> >>
>> >> I'm sorry to be dense, but I don't understand the
>> >> details of your solution.  I'm also not sure I
>> >> understand the problem you are trying to solve.
>> >> The problem description doesn't describe a problem,
>> >> just an event.
>> >>
>> >> I'm guessing the problem is:  When a guest chooses
>> >> TSC as its primary clocksource AND a migration later
>> >> occurs to a host with a different TSC frequency
>> >> THEN wallclock time (e.g. the "date" command)
>> >> becomes incorrect.
>> >
>> >Mostly yes though don't know if guest wall clock depends on
>> >TSC heavily.
>> >
>> >>
>> >> I'm also guessing that you are NOT trying to solve
>> >> the problem:  An application that uses TSC
>> >> heavily to measure the passage of time AND
>> >> calibrates TSC on host A AND invisibly
>> >> migrates to host B with a different TSC
>> >> frequency THEN will NOT be able to accurately
>> >> measure the passage of time.  However, it will
>> >> continue to be monotonically increasing.
>> >
>> >Yes, if we don't scale the TSC.
>> >The proposal tries to solve the problem.
>> >
>> >We can use software trap and emulate to scale the TSC so
>> >that guest TSC after migration is same with that before migration.
>> >
>> >But this is not optimial since the overhead may be too high. So we
>> >propose to use smart scaling, which continuously use TSC_OFFSET,
>> >but adjust the TSC_OFFSET value time to time (today it is fixed),
>> >so that an application that uses TSC heavily to measure the
>> >passage of time
>> >can get correct time.
>> >
>>
>> So we're really not trying to solve the micro-level accuracy if app
>> tries to use TSC for that purpose, which always bias from bare
>> metal as long as running in a VM. Here we're trying to ensure
>> macro-level accuracy and thus ToD in guest after migration, with
>> performance optimized if app in VM uses gettimeofday frequently.
>> In that way, gap between trap vs. notrap would be orders of
>> magnitude.
>>
>> Thanks
>> Kevin
>

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

  reply	other threads:[~2009-04-23  6:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-21 14:17 Xen 4.0 Feature Requests Stephen Spector
2009-04-21 14:53 ` R: " Francesco Gallo
2009-04-22 14:51   ` Kashif Ali
2009-04-22 19:49     ` Alessandro R.
2009-04-23  7:27       ` Robert Dunkley
2009-04-23 13:38         ` Thiago Camargo Martins Cordeiro
2009-04-23 14:34           ` R: [Xen-users] " Robert Dunkley
2009-04-23 15:01             ` R: " Thiago Camargo Martins Cordeiro
2009-04-24  8:50             ` RE: R: [Xen-users] " Kieran Mansley
2009-04-21 16:48 ` Tim Moore
2009-04-21 17:37   ` Paul Schulze
2009-04-21 19:13   ` Jean Guyader
2009-04-22  1:08   ` Dirk Utterback
2009-04-22  1:14     ` Samuel Thibault
2009-04-22  8:08       ` Dirk Utterback
2009-04-22  8:11         ` Samuel Thibault
2009-04-21 18:43 ` Pasi Kärkkäinen
2009-04-21 20:03   ` Andy Burns
2009-04-21 20:10     ` Maximilian Wilhelm
2009-04-22  0:31 ` Philipp Schmid
2009-04-22  1:24   ` Akio Takebe
2009-04-22  1:32     ` TSC virtualization across different host frequency platform migration Dong, Eddie
2009-04-22  8:13       ` Keir Fraser
2009-04-22  8:49         ` Dong, Eddie
2009-04-22 15:47       ` Dan Magenheimer
2009-04-23  1:28         ` Dong, Eddie
2009-04-23  3:20           ` Tian, Kevin
2009-04-23  3:39             ` Dan Magenheimer
2009-04-23  6:15               ` Tian, Kevin [this message]
2009-04-23 13:58                 ` Dan Magenheimer
2009-04-22  1:57     ` Xen 4.0 Feature Requests Ryo Tsuruta
2009-04-22 16:14 ` [Xen-devel] " Thiago Camargo Martins Cordeiro
2009-05-03 18:27 ` Sander Eikelenboom
2009-05-03 20:12   ` Paul Schulze
2009-05-04  5:54     ` Re[2]: " Sander Eikelenboom
2009-05-05 14:24       ` Ian Jackson

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=0A882F4D99BBF6449D58E61AAFD7EDD6136777F7@pdsmsx502.ccr.corp.intel.com \
    --to=kevin.tian@intel.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=eddie.dong@intel.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xiantao.zhang@intel.com \
    --cc=xiaowei.yang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.