From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: TSC deadline timer in guests vs. migration? Date: Mon, 4 Jul 2016 16:17:55 -0400 (EDT) Message-ID: <1372974489.3861514.1467663475048.JavaMail.zimbra@redhat.com> References: <759376f0-e0bf-e53a-99e4-598bf14547e3@redhat.com> <20160704193005.GA28201@amt.cnet> <20160704194506.GE4131@thinpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , David Matlack , Peter Hornyack , KVM list To: Eduardo Habkost Return-path: Received: from mx3-phx2.redhat.com ([209.132.183.24]:45563 "EHLO mx3-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753507AbcGDUR7 (ORCPT ); Mon, 4 Jul 2016 16:17:59 -0400 In-Reply-To: <20160704194506.GE4131@thinpad.lan.raisama.net> Sender: kvm-owner@vger.kernel.org List-ID: > On Mon, Jul 04, 2016 at 04:30:08PM -0300, Marcelo Tosatti wrote: > > On Mon, Jul 04, 2016 at 01:01:42PM +0200, Paolo Bonzini wrote: > > > Can bad things happen if a guest using the TSC deadline timer is > > > migrated? The guest doesn't re-calibrate the TSC after migration, and > > > the TSC frequency can and will change unless your data center is > > > perfectly homogeneous. > > > > It can fire earlier if the destination runs at a higher frequency. > > It will fire past the configured time if the destination runs at a slower > > frequency. > > > > Suppose the first case is worse. > > > > Should convert the expiration time to nanoseconds i suppose, and then > > convert back on the destination. > > This won't make any difference if the guest sets up a new timer > after migration (but using the old TSC frequency), will it? Indeed. We need a way to compute the deadline that is customized for kvmclock, and uses the kvmclock page instead of tsc_khz. Paolo