Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Dec 2009 14:16:56 +0100
From:      Pieter de Goeje <pieter@service2media.com>
To:        svn-src-all@freebsd.org
Cc:        svn-src-head@freebsd.org, Robert Watson <rwatson@freebsd.org>, Luigi Rizzo <luigi@freebsd.org>, src-committers@freebsd.org, Luigi Rizzo <rizzo@iet.unipi.it>
Subject:   Re: svn commit: r200510 - head/sys/kern
Message-ID:  <200912151416.56348.pieter@service2media.com>
In-Reply-To: <20091214144635.GA91618@onelab2.iet.unipi.it>
References:  <200912141223.nBECNlDZ026381@svn.freebsd.org> <alpine.BSF.2.00.0912141418090.61723@fledge.watson.org> <20091214144635.GA91618@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 14 December 2009 15:46:35 Luigi Rizzo wrote:
> On Mon, Dec 14, 2009 at 02:18:42PM +0000, Robert Watson wrote:
> > On Mon, 14 Dec 2009, Luigi Rizzo wrote:
> 
> ...
> 
> > > Together with a smaller patch committed in september, this fixes a
> > > bug that affects 8.0 with apps that rely on callouts to fire exactly
> > > in the number of ticks specified (qemu among them).
> > > Right now, callouts in 8.0 fire one tick late.
> > >
> > > This was discussed in september with JeffR and jhb
> >
> > Once this has burned in, is it something you would consider appropriate
> > to be an errata note candidate?
> 
> i have no objection, but at the time someone commented that
> callouts do not _guarantee_ when they will run so strictly speaking
> this is not a bug (i do think that being always a tick late _is_ a bug).

As a person running a couple of game servers which rely on nanosleep to get a 
fixed number of frames per second, I'd say that it is a bug. This might also 
affect video players which want to show their frames on time.  The default HZ 
of 1000 mitigates the problem somewhat, but on for example a laptop running at 
HZ=100 the error is noticeable.
To illustrate my point, calling usleep(1) 100 times in a loop results in a 
running time of 3 seconds with kern.hz=100 (measured on 8.x from Dec 9th), 
which is 3 times as long as one might reasonably expect. This suggests that 
the callout fires 2 ticks late ...

- Pieter de Goeje




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912151416.56348.pieter>