Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1439811

Re: [RFC PATCH] x86, kvm: use kvmclock to compute TSC deadline value

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH] x86, kvm: use kvmclock to compute TSC deadline value
Date 2016-07-08 23:50 +0200
Message-ID <rSLOO-23d-21@gated-at.bofh.it> (permalink)
References <rRCud-5SZ-3@gated-at.bofh.it> <rRYEp-3A0-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> > Luckily tsc_khz is really used by very little
> > outside the tsc clocksource (which kvmclock replaces) and the TSC
> > deadline timer.
> 
> Two other ways to solve the problem, I don't know if you've considered:
> * Constrain the set of hosts a given VM can run on based on the TSC
> rate. (So don't need a perfectly homogenous fleet, just need each VM
> to be constrained to a homogenous subset).

True.

> * Disable the TSC deadline timer from QEMU by assigning a CPUID with
> the TSC capability zeroed (at least among VMs which could migrate to
> hosts with different TSC rates). These VMs will use the APIC timer
> which runs at a nice fixed rate.

Yes, this is the trivial workaround, but given the nice speedup from
the TSC deadline timer I didn't consider it.

To solve the migration problem I'm thinking of using the kvmclock MSR.
For example, if a bit is set in the kvmclock MSR then userspace should
convert the TSC deadline MSR to nanoseconds on migration and back to TSC
units on the destination.  In other words, it says that the guest is
okay with the TSC deadline MSR changing under its feet when live
migration happens.  But there may be other solutions.

Paolo

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC PATCH] x86, kvm: use kvmclock to compute TSC deadline value Paolo Bonzini <pbonzini@redhat.com> - 2016-07-05 19:40 +0200
  Re: [RFC PATCH] x86, kvm: use kvmclock to compute TSC deadline value Paolo Bonzini <pbonzini@redhat.com> - 2016-07-06 15:10 +0200
  Re: [RFC PATCH] x86, kvm: use kvmclock to compute TSC deadline value Andy Lutomirski <luto@amacapital.net> - 2016-07-06 15:10 +0200
  Re: [RFC PATCH] x86, kvm: use kvmclock to compute TSC deadline value David Matlack <dmatlack@google.com> - 2016-07-06 19:20 +0200
    Re: [RFC PATCH] x86, kvm: use kvmclock to compute TSC deadline  value Paolo Bonzini <pbonzini@redhat.com> - 2016-07-08 23:50 +0200

csiph-web