From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932704AbcBPOAp (ORCPT ); Tue, 16 Feb 2016 09:00:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50095 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932419AbcBPOAn (ORCPT ); Tue, 16 Feb 2016 09:00:43 -0500 Date: Tue, 16 Feb 2016 15:00:17 +0100 From: Marcelo Tosatti To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH 0/4] kvmclock: improve accuracy Message-ID: <20160216140016.GB21944@amt.cnet> References: <1454944711-33022-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454944711-33022-1-git-send-email-pbonzini@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 08, 2016 at 04:18:27PM +0100, Paolo Bonzini wrote: > Currently kvmclock is obtaining the multiplier and shift value from > the TSC kHz. These however are less accurate than the host kernel's > clock, which includes corrections made through NTP. > > These patches change kvmclock to tick at the same frequency as the > host kernel's clocksource (as obtained through the pvclock_gtod > notifier). This is precise enough that the Hyper-V clock can be > implemented on top of it. Note the current option to sync kvmclock periodically every 300 seconds: #define KVMCLOCK_SYNC_PERIOD (300 * HZ) static void kvmclock_sync_fn(struct work_struct *work) { struct delayed_work *dwork = to_delayed_work(work); struct kvm_arch *ka = container_of(dwork, struct kvm_arch, kvmclock_sync_work); struct kvm *kvm = container_of(ka, struct kvm, arch); schedule_delayed_work(&kvm->arch.kvmclock_update_work, 0); schedule_delayed_work(&kvm->arch.kvmclock_sync_work, KVMCLOCK_SYNC_PERIOD); } How large is the error when the corrections are applied every 5 minutes? Does this match the errors you are seeing?