From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eran Rom Subject: guest gettimeofday behavior Date: Thu, 25 Jun 2009 13:25:17 +0000 (UTC) Message-ID: 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]:54624 "EHLO ciao.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756770AbZFYNZb (ORCPT ); Thu, 25 Jun 2009 09:25:31 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MJoxG-0003dB-P4 for kvm@vger.kernel.org; Thu, 25 Jun 2009 13:25:31 +0000 Received: from nesher3.haifa.il.ibm.com ([192.114.107.4]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Jun 2009 13:25:30 +0000 Received: from eranr by nesher3.haifa.il.ibm.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Jun 2009 13:25:30 +0000 Sender: kvm-owner@vger.kernel.org List-ID: Hi All, Am a newbie (to kvm, linux kernel, git, etc.) so apologize in advance for missing/inaccurate info. I am experiencing inconsistent behavior of guest gettimeofday, described below. I have seen prior reference to the problem, however, it was not clear whether the issue was solved or not and where. Below is a description of my setup and the behavior I see. Another question is whether oprofile with timer mode would suffer from the same problem? Otherwise I saw that kvm-85 has "generic performance counter msr handling", does this mean that oprofile can be executed without the timer mode? Thanks very much, Eran Setup: Guest 32 bit ubuntu with 2.6.27 kernel Host 64 bit Suse 10.2 with 2.6.27 kernel 1 quadcore Intel Xeon CPU I am not sure about the kvm userspace code version. Used git to create a repository, and then did git checkout kvm-updates-2.6.27 (is that fixed in time?) 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