From: Denis Plotnikov <dplotnikov@virtuozzo.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
rkrcmar@redhat.com, kvm@vger.kernel.org
Cc: rkagan@virtuozzo.com, den@virtuozzo.com, svt-core@lists.sw.ru
Subject: Re: [PATCH v3 2/6] KVM: x86: switch to masterclock update using timekeeper functionality
Date: Tue, 1 Aug 2017 15:46:54 +0300 [thread overview]
Message-ID: <c93e557f-7cf8-ad4b-eb57-e012ebf809a3@virtuozzo.com> (raw)
In-Reply-To: <399f7166-0f18-a1b8-b236-66baccf410b9@redhat.com>
On 01.08.2017 15:41, Paolo Bonzini wrote:
> On 01/08/2017 14:11, Denis Plotnikov wrote:
>> In fact, this "cycles_valid" is going to be used for deciding whether to
>> use KVM masterclock or not. And if it's not we still want to know
>> cycles_stamp value to use it in KVM.
>
> Why? Neither pvclock_update_vm_gtod_copy nor kvm_pv_clock_pairing do
> anything with the two variables that are passed by reference, if the
> read returns false. Hence my suggestion of calling it cycles_valid.
giving up
>
>> So the cycles is valid, but clocksource is not reliable (why? let decide
>> to a clocksource, by default assume they are all not stable), thus we
>> must calculate time values for a guest each time its needed.
>> So, my proposal is to name the variable sightly differently: cs_reliable
>> and go like:
>> if (clock->read_clock_with_stamp) {
>> systime_snapshot->cs_reliable =
>> clock->read_clock_with_stamp(
>> &now, &systime_snapshot->cycles);
>> } else {
>> now = tk_clock_read(&tk->tkr_mono);
>> systime_snapshot->cs_reliable = false;
>> systime_snapshot->cycles = now;
>> }
>> What do you think?
>
> I'm afraid you still have to define the meaning of "reliable". (Though
> I agree that the right default is false, that was a thinko on my side.
> This also means that you need to define read_clock_with_stamp for the
> TSC clocksource too).
>
> Paolo
>
agree
name: cycles_valid
default: false
read_clock_with_stamp: defined for tsc returning true
Thanks!
Patches are in progress.
They well be sent soon, nice and shiny!
Denis
next prev parent reply other threads:[~2017-08-01 12:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-29 12:35 [PATCH v3 0/6] make L2's kvm-clock stable, get rid of pvclock_gtod Denis Plotnikov
2017-07-29 12:35 ` [PATCH v3 1/6] pvclock: add parameter to store cycles stamp to pvclock reading function Denis Plotnikov
2017-07-31 14:08 ` Paolo Bonzini
2017-07-29 12:35 ` [PATCH v3 2/6] KVM: x86: switch to masterclock update using timekeeper functionality Denis Plotnikov
2017-07-31 14:20 ` Paolo Bonzini
2017-08-01 9:30 ` Denis Plotnikov
2017-08-01 10:03 ` Paolo Bonzini
2017-08-01 10:16 ` Paolo Bonzini
2017-08-01 12:11 ` Denis Plotnikov
2017-08-01 12:28 ` Denis Plotnikov
2017-08-01 12:41 ` Paolo Bonzini
2017-08-01 12:46 ` Denis Plotnikov [this message]
2017-08-01 17:47 ` Radim Krčmář
2017-07-29 12:35 ` [PATCH v3 3/6] timekeeper: add clocksource change notifier Denis Plotnikov
2017-07-29 12:35 ` [PATCH v3 4/6] KVM: x86: remove not used pvclock_gtod_copy Denis Plotnikov
2017-07-29 12:35 ` [PATCH v3 5/6] pvclock: add clocksource change notification on changing of tsc stable bit Denis Plotnikov
2017-07-31 14:21 ` Paolo Bonzini
2017-07-29 12:35 ` [PATCH v3 6/6] kvmclock: add the clocksource stability querying function Denis Plotnikov
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=c93e557f-7cf8-ad4b-eb57-e012ebf809a3@virtuozzo.com \
--to=dplotnikov@virtuozzo.com \
--cc=den@virtuozzo.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkagan@virtuozzo.com \
--cc=rkrcmar@redhat.com \
--cc=svt-core@lists.sw.ru \
/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).