All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joao Martins <joao.m.martins@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Dario Faggioli <dario.faggioli@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/time: use correct (local) time stamp in constant-TSC calibration fast path
Date: Thu, 9 Jun 2016 19:19:04 +0100	[thread overview]
Message-ID: <5759B318.2090208@oracle.com> (raw)
In-Reply-To: <5759ACD802000078000F3A78@prv-mh.provo.novell.com>

[changing Dario address to citrix.com as it was bouncing for me ]

On 06/09/2016 04:52 PM, Jan Beulich wrote:
>>>> On 09.06.16 at 17:00, <joao.m.martins@oracle.com> wrote:
>> On 06/09/2016 01:57 PM, Jan Beulich wrote:
>>>>>> On 09.06.16 at 14:11, <joao.m.martins@oracle.com> wrote:
>>> So in effect for the fast path the patch
>>> changes the situation from c->stime_local_stamp being effectively
>>> unused to c->stime_master_stamp being so. In the former case, if
>>> that really hadn't been a typo, deleting the write of that field from
>>> time_calibration_std_rendezvous() would have made sense, as
>>> get_s_time() certainly is more overhead than the simply memory
>>> read and write needed for keeping c->stime_master_stamp up to
>>> date (despite not being used).
>> I agree, but what I meant previously was more of a concern meaning: CPU 0 is 
>> doing an
>> expensive read_platform_time (e.g. HPET supposedly microseconds order, plus 
>> a
>> non-contented lock) to set stime_master_stamp that doesn't get used at all -
>> effectively not using the clocksource set initially at boot.
> 
> Yeah, there's likely some cleanup potential here, but of course we
> need to be pretty careful about not doing something that may be
> needed by some code paths but not others. But if you think you
> can help the situation without harming maintainability, feel free to
> go ahead.
> 
OK, Makes sense. I'll likely do already so of it on my related series.

>> What if verify_tsc_reliability clears out X86_FEATURE_TSC_RELIABLE when 
>> failing
>> the warp test? The calibration function is set early on right after 
>> interrupts are
>> enabled and the time warp check later on when all CPUs are up. So on 
>> problematic
>> platforms it's possible that std_rendezvous is used with a constant TSC but 
>> still
>> deemed unreliable. We still keep incrementing deltas at roughly about the 
>> same time,
>> but in effect with this change the stime_local_stamp would be TSC-only based 
>> thus
>> leading to warps with an unreliable TSC? And there's also the CPU 
>> hotplug/onlining
>> case that we once discussed.
> 
> I agree that we're likely in trouble in such a case. But for the
> moment I'd be glad if we could get the "normal" case work right.
> 
OK. Apologies for the noise, I was just pointing out things that I tried and some
also discussed here in the PVCLOCK_TSC_STABLE_BIT series, although didn't cross me
that Xen own idea of time could be a little broken. IMO adding another clocksource
for TSC would be more correct if we are only using TSC (and having its associated
limitations made aware/explicit to the user) rather then being on the back of another
clocksource in use. But it wouldn't cover the normal case :( unless set manually

NB: Guests on the other hand aren't affected since they take care of keeping the
latest stamp when different vCPUS slightly diverge.

Joao

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

  reply	other threads:[~2016-06-09 18:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09 12:01 [PATCH] x86/time: use correct (local) time stamp in constant-TSC calibration fast path Jan Beulich
2016-06-09 12:10 ` Andrew Cooper
2016-06-09 12:11 ` Joao Martins
2016-06-09 12:57   ` Jan Beulich
2016-06-09 15:00     ` Joao Martins
2016-06-09 15:52       ` Jan Beulich
2016-06-09 18:19         ` Joao Martins [this message]
2016-06-10  6:59           ` Jan Beulich
2016-06-10  9:29             ` Jan Beulich
2016-06-10 17:07               ` Joao Martins
2016-06-09 12:12 ` Wei Liu

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=5759B318.2090208@oracle.com \
    --to=joao.m.martins@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=wei.liu2@citrix.com \
    --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 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.