From mboxrd@z Thu Jan 1 00:00:00 1970 From: Espen Berg Subject: Re: Timedrift in KVM guests after livemigration. Date: Sun, 18 Apr 2010 11:33:44 +0200 Message-ID: <4BCAD1F8.1080903@monsternett.no> References: <4BC6C1B1.5010206@monsternett.no> <4BCA1164.1030808@monsternett.no> <4BCA1756.6060800@msgid.tls.msk.ru> <4BCA4296.2080608@monsternett.no> <4BCACF6E.4010108@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from mail2.monsternett.no ([217.171.192.11]:37498 "EHLO mail.monsternett.no" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755277Ab0DRJeg (ORCPT ); Sun, 18 Apr 2010 05:34:36 -0400 Received: from localhost (filter.monsternett.no [217.171.192.14]) by mail.monsternett.no (Postfix) with ESMTP id 3DE82C0A848F for ; Sun, 18 Apr 2010 11:34:35 +0200 (CEST) Received: from mail.monsternett.no ([217.171.192.10]) by localhost (filter.monsternett.no [217.171.192.14]) (amavisd-new, port 10024) with ESMTP id Ifb5uVpcBVMe for ; Sun, 18 Apr 2010 11:34:32 +0200 (CEST) Received: from [217.171.199.6] (ws14.monsternett.no [217.171.199.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.monsternett.no (Postfix) with ESMTPSA id 77052C0A8496 for ; Sun, 18 Apr 2010 11:34:32 +0200 (CEST) In-Reply-To: <4BCACF6E.4010108@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Den 18.04.2010 11:22, skrev Dor Laor: >>> What do you mean by "adopts" ? Note that the cpu frequency >>> means nothing for all the modern operating systems, at least >>> since the days of common usage of MS-DOS which relied on CPU >>> frequency for its time functions. All interesting things are >>> now done using timers instead, and timers (which don't depend >>> on CPU frequency again) usually work quite well. >> The assumption that frequency of the ticks was calculated by the hosts >> MHz, was based on the fact that grater clock frequency differences >> caused higher time drift. 60 MHz difference caused about 24min drift, >> 332 MHz difference caused about 2h25min drift. >>> What complicates things is that the most cheap and accurate >>> enough time source is TSC (time stamp counter register in >>> the CPU), but it will definitely be different on each >>> machine. For that, 0.12.3 kvm and 2.6.32 kernel (I think) >>> introduced a compensation. See for example -tdf kvm option. >> Ah, nice to know. :) > That's two different things here: > The issue that Espen is reporting is that the hosts have different > frequency and guests that relay on the tsc as a source clock will notice > that post migration. The is indeed a problem that -tdf does not solve. > -tdf only adds compensation for the RTC clock emulation. > > What's the guest type and what's the guest's source clock? All guest are Debian lenny with latest upstream kernel, hvm/kvm. We are using kvm-clock as guest source clock. cat /sys/devices/system/clocksource/clocksource0/current_clocksource kvm-clock Regards Espen