From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: What time is it kvm-clock? Date: Wed, 24 Feb 2016 21:17:58 +0100 Message-ID: <20160224201757.GA6355@potion.redhat.com> References: <20160224035753.GA6681@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , Owen Hofmann , KVM General , Paolo Bonzini , Andy Lutomirski To: Peter Hornyack Return-path: Received: from mx1.redhat.com ([209.132.183.28]:57530 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756887AbcBXUSC (ORCPT ); Wed, 24 Feb 2016 15:18:02 -0500 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 2016-02-24 09:35-0800, Peter Hornyack: > On Tue, Feb 23, 2016 at 7:57 PM, Marcelo Tosatti wrote: >> On Tue, Feb 23, 2016 at 06:31:59PM -0800, Owen Hofmann wrote: >>> Regardless of my opinion, I think that a clear statement of the design >>> goals for kvm-clock (and kvm's implementation of the reference TSC >>> page) would be valuable. >> >> Documentation/virtual/kvm/timekeeping.txt >> > > Hi Marcelo, > > While I appreciate all of the detail in timekeeping.txt, it is not a > very good reference for what kvm-clock is or how it works. kvm-clock > is only mentioned three times in different places throughout that > document, and nowhere is there a very clear statement of what > kvm-clock is supposed to do or how it does it. > > For somebody that does not already have a deep understanding of the > core masterclock code, trying to understand how kvm-clock works is a > real challenge. I agree. Having an overview would be very helpful. Do you find anything incorrect with * kvmclock measures the flow of time. * time in kvmclock flows at the same rate as host's CLOCK_BOOTTIME. ? Maybe it would be better to say "best estimate of real time" instead of "CLOCK_BOOTTIME", so people wouldn't jump to conclusion that CLOCK_BOOTTIME has something to do with kvmclock ... Then we could mention migration (why the time becomes imprecise) and finish by explaining the TSC mechanism (that avoids a vmexit on every read) and advantages of masterclock.