From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hollis Blanchard Subject: Re: gettimeofday "slow" in RHEL4 guests Date: Tue, 25 Nov 2008 11:20:06 -0600 Message-ID: <1227633606.7434.14.camel@localhost.localdomain> References: <492AE8AC.2090502@cisco.com> <492B8204.5@cisco.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm-devel , Marcelo Tosatti , Glauber de Oliveira Costa , Avi Kivity To: "David S. Ahern" Return-path: Received: from e36.co.us.ibm.com ([32.97.110.154]:42146 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752078AbYKYRUV (ORCPT ); Tue, 25 Nov 2008 12:20:21 -0500 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e36.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id mAPHJgYY005810 for ; Tue, 25 Nov 2008 10:19:42 -0700 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mAPHKE7J152288 for ; Tue, 25 Nov 2008 10:20:16 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mAPHKAfh026703 for ; Tue, 25 Nov 2008 10:20:10 -0700 In-Reply-To: <492B8204.5@cisco.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 2008-11-24 at 21:41 -0700, David S. Ahern wrote: > > RHEL3 (which is based on the 2.4.21 kernel) gets microsecond > resolutions > by reading the TSC. Reading the TSC from within a guest is very fast > on kvm. > > RHEL4 (which is basd on the 2.6.9 kernel) allows multiple time > sources: > pmtmr (ACPI power management timer which is the default), pit, hpet > and TSC. > > The pmtmr and pit both do ioport reads to get microsecond resolutions > (see read_pmtmr and get_offset_pit, respectively). For the tsc as the > timer source gettimeofday is *very* lightweight, but time drifts very > badly and ntpd cannot acquire a sync. Why aren't you seeing severe time drift when using RHEL3 guests with the TSC time source? -- Hollis Blanchard IBM Linux Technology Center