From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eran Rom Subject: Re: guest gettimeofday behavior Date: Mon, 29 Jun 2009 19:11:32 +0000 (UTC) Message-ID: References: <4A4730B9.1090902@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from main.gmane.org ([80.91.229.2]:47681 "EHLO ciao.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752283AbZF2TLp (ORCPT ); Mon, 29 Jun 2009 15:11:45 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MLMGV-00027O-6B for kvm@vger.kernel.org; Mon, 29 Jun 2009 19:11:43 +0000 Received: from 94.188.129.18 ([94.188.129.18]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Jun 2009 19:11:43 +0000 Received: from eranr by 94.188.129.18 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Jun 2009 19:11:43 +0000 Sender: kvm-owner@vger.kernel.org List-ID: Dor Laor redhat.com> writes: > > On 06/25/2009 04:25 PM, Eran Rom wrote: > > Behavior: > > Running a code doing: > > t1 = gettimeofday > > t2 = gettimeofday > > while t2-t1< 5 minutes { > > sleep(1) > > t2 = gettimeofday > > } > > > > Ran it 10 times, each time in a 'newly launched' VM, > > halting it after the test. > > 8 out of 10 times the wall clock showed 5 minutes > > 1 time 4 minutes and 40 seconds > > 1 time 0 seconds > > > > I'm not sure what's your 'wall clock' value, > there is not printf in your > script. the 'wall clock' is host time. Here is what I am doing form the host: #! /bin/bash date ssh $GuestIP run_gettimeofday_binary date > Nevertheless, the tsc clock is not reliable, > the host can scale it, or > go into > deep sleep state. indeed my current clock source is tsc > > So either use newer kernel with kvmclock (pv) > or change the clock source > into rtc/pit > No rtc/pit in my available clock sources, however, I assume its a question of kernel compilation parameters, is that right? What is the advantage of rtc/pit/kvmclock (pv)over tsc? Also, is kvmclock (pv) better than the other two options. the thing is that I am 'confined' to use 2.6.27, and if I decide on kvmclock, i will need to add it 'manually' Thanks, Eran > > -- > > To unsubscribe from this list: send the line "unsubscribe kvm" in > > the body of a message to majordomo vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > >