svn commit: r200510 - head/sys/kern
Pieter de Goeje
pieter at service2media.com
Tue Dec 15 05:29:04 PST 2009
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
More information about the svn-src-all