From owner-cvs-src@FreeBSD.ORG Sun Nov 27 13:23:02 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B785E16A41F; Sun, 27 Nov 2005 13:23:02 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06D8243D4C; Sun, 27 Nov 2005 13:23:02 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 99D8C46B6B; Sun, 27 Nov 2005 08:23:00 -0500 (EST) Date: Sun, 27 Nov 2005 13:23:00 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Bruce Evans In-Reply-To: <20051127234937.X28222@delplex.bde.org> Message-ID: <20051127131838.F81764@fledge.watson.org> References: <200511270055.jAR0tIkF032480@repoman.freebsd.org> <20051127005622.H81764@fledge.watson.org> <20051127234937.X28222@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys time.h src/sys/kern kern_time.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2005 13:23:02 -0000 On Mon, 28 Nov 2005, Bruce Evans wrote: > % /* > % * Small wrapper library to substitute implementations of gettimeofday(2) > and > % * time(3) with lower resolution variations. time(3) is unconditionally > % * degraded, since it will return a truncated time anyway. gettimeofday(3) > % * checks the TIMEWRAPPER environmental variable, which can be set to > either > % * "PRECISE" or "FAST". > % */ > > time(3) should use the environment variable too, since the fast version > gives a value that is both imprecise and wrong. It inherits bugs from > the kernel's time_second variable. time_second is not the current time > truncated, but is the (current time less up to about tc_tick/HZ) > truncated. It lags the current time by more than 1 second for up to > about tc_tick/HZ seconds before every rollover of the correct truncated > time. Yes -- this is a mistake in the current library wrapper. All interfaces modified to be "fast" or "precise" should be controlled by the environmental variable so that testing is more consistent (i.e., other than wrapping costs, the non-configured version should behave identically to the non-wrapped version). As mentioned in my previous e-mail, I have no particular commitment to any particular implementation of "fast", but feel that to understand the implications of time measurement costs on applications, we need some way to express this. The POSIX APIs seem to lack any way for an application to express its requirements for time quality vs performance, meaning that if a system errs on the side of quality (FreeBSD), applications will perform much more slowly and potentially no better than on a system which errs on the side of performance (Linux). We work very hard to provide very accurate time stamps for applications that sometimes don't need them, and while uniformly degrading quality doesn't make sense, a bit more expressiveness appears to be required to do better. Robert N M Watson