Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jan 2002 02:02:20 -0500 (EST)
From:      Mike Silbersack <silby@silby.com>
To:        <freebsd-arch@freebsd.org>
Subject:   Re: DELAY accuracy Re: cvs commit: src/sys/dev/usb uhci.c
Message-ID:  <Pine.BSF.4.30.0201030159530.56510-100000@niwun.pair.com>
In-Reply-To: <Pine.BSF.4.30.0201022210450.31679-100000@niwun.pair.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, 2 Jan 2002, Mike Silbersack wrote:

> This commit log started me wondering about DELAY usage in the kernel.
> Looking around, we do have a decent amount of such calls.  Most of the
> calls seem to be for 100 us or less, with some as short a 1 us.  These
> times seem short, but looking at sys/i386/isa/clock.c, I see that we time
> based off the i8254 timer chip, rather than the processor's TSC.  As such,
> are we actually reaching microsecond accuracy, or is the delay actually
> taking longer than expected in many of these cases?
>
> Thanks,
>
> Mike "Silby" Silbersack

To answer my own question, there seems to be about 8us of slop added to
each call to DELAY.  This seems irrelevant for calls of 100 or 1000, but
changes timing quite a bit on calls between 1 and 10.  So, it looks like
rewriting DELAY so that it spin-waits on the TSC for delays of less than
100 might be useful.  Maybe when I get some time...

Mike "Silby" Silbersack


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.30.0201030159530.56510-100000>