From owner-freebsd-current Fri Oct 20 22:43:53 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id WAA04227 for current-outgoing; Fri, 20 Oct 1995 22:43:53 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id WAA04222 for ; Fri, 20 Oct 1995 22:43:43 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id PAA05176; Sat, 21 Oct 1995 15:42:21 +1000 Date: Sat, 21 Oct 1995 15:42:21 +1000 From: Bruce Evans Message-Id: <199510210542.PAA05176@godzilla.zeta.org.au> To: joerg_wunsch@uriah.heep.sax.de, wollman@lcs.mit.edu Subject: Re: clock running faster? Cc: freebsd-current@FreeBSD.org Sender: owner-current@FreeBSD.org Precedence: bulk >>> The changes have the effect of making the Pentium clock the reference. >> I don't think this has been a good idea. >Please explain your reason for believing this, keeping in mind that a >similar technique was used on MicroVAXen in 4.3 (except using >microtime() rather than a purpose-built function). The 8254 clock, being intended for timekeeping, is perhaps more accurate and/or stable than the system clock. The system clock should be slowed down to save power when the system is not in use... Perhaps apm compensates for this. See apm_default_suspend() and apm_default_resume() in apm.c. Hmm. These routines seem to be buggy. inittodr() has a resolution of 1 second and is called twice for each suspend/resume. There is more jitter for residuals in the counters. The 8254 residual is limited to the (small) maximum count, but if the Pentium clock continues to run while clock interrupts are masked, then its residual is bounded only by the 64 bits in the counter register. This is a problem for settimeofday() too, but then the residuals are limited to what has accumulated since the last clock interrupt. The splsoftclock() in apm_default_suspend() is a bug. splsoftclock() doesn't nest. It sets the pl to the softclock pl, blowing away the previous pl. Masking softclock() is neither necessary for calling microtime() or inittodr() nor sufficient for atomicicity. Bruce