From owner-freebsd-arch Thu Jan 3 12: 2:27 2002 Delivered-To: freebsd-arch@freebsd.org Received: from swan.prod.itd.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by hub.freebsd.org (Postfix) with ESMTP id 5CE7037B41D for ; Thu, 3 Jan 2002 12:02:13 -0800 (PST) Received: from pool0238.cvx40-bradley.dialup.earthlink.net ([216.244.42.238] helo=mindspring.com) by swan.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16ME3t-0003nI-00; Thu, 03 Jan 2002 12:02:01 -0800 Message-ID: <3C34B8BB.BAF3DB2B@mindspring.com> Date: Thu, 03 Jan 2002 12:02:03 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Poul-Henning Kamp Cc: Bruce Evans , Mike Silbersack , freebsd-arch@FreeBSD.ORG Subject: Re: DELAY accuracy Re: cvs commit: src/sys/dev/usb uhci.c References: <831.1010050137@critter.freebsd.dk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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