From owner-freebsd-current@FreeBSD.ORG Wed Jul 21 10:26:24 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id EDAE916A4CE; Wed, 21 Jul 2004 10:26:23 +0000 (GMT) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.12.11/8.12.11) with ESMTP id i6LAQMMT095008; Wed, 21 Jul 2004 06:26:22 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.12.11/8.12.11/Submit) id i6LAQLfL095007; Wed, 21 Jul 2004 06:26:21 -0400 (EDT) (envelope-from green) Date: Wed, 21 Jul 2004 06:26:20 -0400 From: Brian Fundakowski Feldman To: John Birrell Message-ID: <20040721102620.GF1009@green.homeunix.org> References: <20040721081310.GJ22160@freebsd3.cimlogic.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040721081310.GJ22160@freebsd3.cimlogic.com.au> User-Agent: Mutt/1.5.6i cc: current@freebsd.org Subject: Re: nanosleep returning early X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2004 10:26:24 -0000 On Wed, Jul 21, 2004 at 06:13:10PM +1000, John Birrell wrote: > > Today I increased HZ in a current kernel to 1000 when adding dummynet. > Now I find that nanosleep regularly comes back a little early. > Can anyone explain why? > > I would have expected that the *overrun* beyond the required time to vary, > but never that it would come back early. Is this a difference from clock_gettime(CLOCK_MONOTONIC)? You really shouldn't be using gettimeofday() foor internal timing since the system clock can be adjusted by NTP. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\