From: "Dan Magenheimer" <dan.magenheimer@oracle.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
"Xen-Devel (E-mail)" <xen-devel@lists.xensource.com>
Subject: RE: Guest TSC and Xen (Intel and AMD feedback please)
Date: Wed, 2 Jul 2008 19:21:02 -0600 [thread overview]
Message-ID: <20080702192102921.00000003744@djm-pc> (raw)
In-Reply-To: <D470B4E54465E3469E2ABBC5AFAC390F024D94E8@pdsmsx412.ccr.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2763 bytes --]
Hi Kevin --
> constant_tsc is one of the factors affecting tsc stability, and
> the keypoint is that one internal variable 'tsc_unstable' is
> initialized to zero. That means, kernel considers TSC as
> stable by default, and you need trigger some factors upon
> which guest kernel'd like to mark tsc as unstable when
> checking them. However by far none of those factors seem
> appliable to all circumstances.
>
> For example, even by hidding constant_tsc bit from cpuid,
> UP guest will still consider tsc as stable, and so does 32bit
> SMP guest running on Intel processors.
Yes, looking over some Linux code, I see you are right. In
one version of RH, if the processor vendor is Intel, it
always assumes tsc is stable!
> Since it's 'if', we should treat it as an option, instead of 'NEVER',
> right? User may not have migration requirement in some cases,
> and or the migratable backups are with same bits exactly... :-)
Yes, if it could be done, I agree an option would be better
than 'NEVER'. But Keir is not too keen on more time-related
options.
> >2) I *think* that in some cases even within the same system,
> > TSC values will skew somewhat. Since a uniprocessor guest
> > will often be rescheduled to a different pcpu by Xen,
> > the underlying tsc may appear erratic.
>
> Can't be the tsc kept monotonic to guest, with some tweak on
> tsc offset? Also Xen is always trying to sync tsc among cores.
> As long as you don't run on a box with multiple bus crystals,
> or a box without constant tsc upon freq change, the tsc drift
> among cores should be negligible considering the overhead of
> migration. Then for cases out of 'as long as', we should mark
> TSC as unstable, still as an option.
No Xen doesn't actally sync the tsc's, just maintains its own
software offset variables. I suppose it could periodically check
to make sure the tsc skew is within some reasonable value,
but after the guest boots, it is probably too late.
> I vaguely recalled some posts about CPUID virtualization
> framework. There's no need to a seperate category, and it
> looks like this option can be aligned with that part?
Yes, good point. I wasn't following that closely either but
this could be covered by it.
> >Another alternative would be to trap all rdtsc's and emulate
> >them but this probably will not be easy and may have
> >significant performance implications. But perhaps it should
> >be an option?
>
> Agree.
Is this something that you (or Intel in general) could look at?
I would be happy to participate but I don't think I understand
VT well enough. Once the trap occurs, I suppose Xen system time
could be used as the virtual TSC, possibly scaled up.
Thanks,
Dan
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2008-07-03 1:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-01 17:33 Guest TSC and Xen (Intel and AMD feedback please) Dan Magenheimer
2008-07-01 17:40 ` Keir Fraser
2008-07-02 2:52 ` Tian, Kevin
2008-07-03 1:21 ` Dan Magenheimer [this message]
2008-07-04 0:56 ` Tian, Kevin
2008-07-04 17:31 ` Dan Magenheimer
2008-07-08 1:38 ` Tian, Kevin
2008-07-08 2:28 ` Zhang, Li
2008-07-08 2:59 ` Zhang, Li
2008-07-08 3:34 ` Dan Magenheimer
2008-07-08 4:21 ` Tian, Kevin
2008-07-08 6:49 ` Zhang, Li
2008-07-08 6:58 ` Zhang, Li
2008-07-08 9:46 ` Zhang, Li
2008-07-08 14:48 ` Dave Winchell
2008-07-08 14:56 ` Keir Fraser
2008-07-09 0:29 ` Dan Magenheimer
2008-07-09 21:32 ` [PATCH] softtsc (was RE: Guest TSC and Xen (Intel and AMD feedback please)) Dan Magenheimer
2008-07-10 1:48 ` Zhang, Li
2008-07-10 9:18 ` Keir Fraser
2008-07-10 14:19 ` Dan Magenheimer
2008-07-10 14:29 ` Keir Fraser
[not found] <878wwltk01.fsf@basil.nowhere.org>
2008-07-01 21:43 ` Guest TSC and Xen (Intel and AMD feedback please) Dan Magenheimer
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=20080702192102921.00000003744@djm-pc \
--to=dan.magenheimer@oracle.com \
--cc=kevin.tian@intel.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 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.