xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Claudemir Todo Bom <claudemir@todobom.com>
Subject: Re: [PATCH v2 2/3] x86/time: adjust time recording time_calibration_tsc_rendezvous()
Date: Mon, 8 Feb 2021 12:05:16 +0100	[thread overview]
Message-ID: <YCEa7JxPCAzyWqfe@Air-de-Roger> (raw)
In-Reply-To: <861c931e-7922-0b5b-58a9-63e46ba24af0@suse.com>

On Mon, Feb 08, 2021 at 11:56:01AM +0100, Jan Beulich wrote:
> On 05.02.2021 17:15, Roger Pau Monné wrote:
> > On Mon, Feb 01, 2021 at 01:43:04PM +0100, Jan Beulich wrote:
> >> The (stime,tsc) tuple is the basis for extrapolation by get_s_time().
> >> Therefore the two better get taken as close to one another as possible.
> >> This means two things: First, reading platform time is too early when
> >> done on the first iteration. The closest we can get is on the last
> >> iteration, immediately before telling other CPUs to write their TSCs
> >> (and then also writing CPU0's). While at the first glance it may seem
> >> not overly relevant when exactly platform time is read (when assuming
> >> that only stime is ever relevant anywhere, and hence the association
> >> with the precise TSC values is of lower interest), both CPU frequency
> >> changes and the effects of SMT make it unpredictable (between individual
> >> rendezvous instances) how long the loop iterations will take. This will
> >> in turn lead to higher an error than neccesary in how close to linear
> >> stime movement we can get.
> >>
> >> Second, re-reading the TSC for local recording is increasing the overall
> >> error as well, when we already know a more precise value - the one just
> >> written.
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> > Acked-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Thanks.
> 
> > I've been thinking this all seems doomed when Xen runs in a virtualized
> > environment, and should likely be disabled. There's no point on trying
> > to sync the TSC over multiple vCPUs as the scheduling delay between
> > them will likely skew any calculations.
> 
> We may want to consider to force the equivalent of
> "clocksource=tsc" in that case. Otoh a well behaved hypervisor
> underneath shouldn't lead to us finding a need to clear
> TSC_RELIABLE, at which point this logic wouldn't get engaged
> in the first place.

I got the impression that on a loaded system guests with a non-trivial
amount of vCPUs might be in trouble to be able to schedule them all
close enough for the rendezvous to not report a big skew, and thus
disable TSC_RELIABLE?

Thanks, Roger.


  reply	other threads:[~2021-02-08 11:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 12:41 [PATCH v2 0/3] x86/time: calibration rendezvous adjustments Jan Beulich
2021-02-01 12:42 ` [PATCH v2 1/3] x86/time: change initiation of the calibration timer Jan Beulich
2021-02-05 16:00   ` Roger Pau Monné
2021-02-01 12:43 ` [PATCH v2 2/3] x86/time: adjust time recording time_calibration_tsc_rendezvous() Jan Beulich
2021-02-05 16:15   ` Roger Pau Monné
2021-02-08 10:56     ` Jan Beulich
2021-02-08 11:05       ` Roger Pau Monné [this message]
2021-02-08 11:50         ` Jan Beulich
2021-02-08 16:39           ` Roger Pau Monné
2021-02-01 12:43 ` [PATCH v2 3/3] x86/time: don't move TSC backwards in time_calibration_tsc_rendezvous() Jan Beulich
2021-02-02  8:16   ` Jan Beulich
2021-02-08  9:38   ` Roger Pau Monné
2021-02-08 11:22     ` Jan Beulich
2021-02-08 13:19       ` Roger Pau Monné
2021-02-08 13:59         ` Jan Beulich
2021-02-08 16:33           ` Roger Pau Monné

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=YCEa7JxPCAzyWqfe@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=claudemir@todobom.com \
    --cc=jbeulich@suse.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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).