From: Igor Mammedov <imammedo@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
x86@kernel.org
Subject: Re: [PATCH] ensure guest's kvmclock never goes backwards when TSC jumps backward
Date: Wed, 16 Jul 2014 17:18:58 +0200 [thread overview]
Message-ID: <20140716171858.6c8cd597@igors-macbook-pro.local> (raw)
In-Reply-To: <53C69269.3080204@redhat.com>
On Wed, 16 Jul 2014 16:55:37 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 16/07/2014 16:51, Igor Mammedov ha scritto:
> >>>> I'm not sure that a per-CPU value is enough; your patch can make
> >>>> the problem much less frequent of course, but I'm not sure
> >>>> neither detection nor correction are 100% reliable. Your
> >>>> addition is basically a faster but less reliable version of the
> >>>> last_value logic.
> >>>
> >>> How is it less reliable than last_value logic?
> >>
> >> Suppose CPU 1 is behind by 3 nanoseconds
> >>
> >> CPU 0 CPU 1
> >> time = 100 (at time 100)
> >> time = 99 (at time 102)
> >> time = 104 (at time 104)
> >> time = 105 (at time 108)
> >>
> >> Your patch will not detect this.
> > Is it possible for each cpu to have it's own time?
>
> Yes, that's one of the reasons for TSC not to be stable (it could
> also happen simply because the value of TSC_ADJUST MSR is bogus).
I was wondering not about TSC but kvmclock -> sched_clock.
If they are percpu and can differ for each CPU than above diagram if
fine as far as time on each CPU is monotonic and there is not need to
detect that time on each CPU is different.
>
> Paolo
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2014-07-16 15:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 9:52 Igor Mammedov
2014-07-16 10:18 ` Paolo Bonzini
2014-07-16 11:41 ` Marcelo Tosatti
2014-07-16 13:55 ` Igor Mammedov
2014-07-16 14:16 ` Paolo Bonzini
2014-07-16 14:51 ` Igor Mammedov
2014-07-16 14:55 ` Paolo Bonzini
2014-07-16 15:18 ` Igor Mammedov [this message]
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=20140716171858.6c8cd597@igors-macbook-pro.local \
--to=imammedo@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®