Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Jan 2002 12:02:03 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Bruce Evans <bde@zeta.org.au>, Mike Silbersack <silby@silby.com>, freebsd-arch@FreeBSD.ORG
Subject:   Re: DELAY accuracy Re: cvs commit: src/sys/dev/usb uhci.c
Message-ID:  <3C34B8BB.BAF3DB2B@mindspring.com>
References:  <831.1010050137@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote:
> I have actually thought about DELAY() a fair bit.

Go figure.  8-).  (Poul is our timecounter guru).


> I agree that code shouldn't depend too much on the accuracy of DELAY()
> but on the other hand I think we can do much better than we do today.

This is the number one take-away: depend *only* on the DELAY()
being *AT LEAST* as long as the specified interval.


> Obviously, nanosleep() will need a MD part for short delays, but long
> delays can be handled MI in timecounter land, since the timecounters
> have already hold of the hardware.
> 
> On the other hand, nanosleep() would mostly be for very short intervals,
> and the changes that for instance the TSC might experience are minor
> compared to the interval.

Actually, this misses the middle case, where you want a longer
interval, but its termination point still requires very high
resolution (yes, I know that "+/-3uS after 6 hours" would be
weird, but "+/-3uS" after some interval a couple of orders of
magnitude larger tha "1uS" does make sense -- e.g. floppy disk
and other cruddy hardware).


> Summary:
>         a) A lot more can be done to improve things.
>         b) Not doing so properly discourages people from using it.

Both good things... 8-).

-- Terry

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?3C34B8BB.BAF3DB2B>