From owner-freebsd-arch Thu Jan 3 3:42:43 2002 Delivered-To: freebsd-arch@freebsd.org Received: from critter.freebsd.dk (esplanaden.cybercity.dk [212.242.40.114]) by hub.freebsd.org (Postfix) with ESMTP id 4AE8137B405 for ; Thu, 3 Jan 2002 03:42:40 -0800 (PST) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.6/8.11.6) with ESMTP id g039Sv600833; Thu, 3 Jan 2002 10:28:57 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Bruce Evans Cc: Mike Silbersack , freebsd-arch@FreeBSD.ORG Subject: Re: DELAY accuracy Re: cvs commit: src/sys/dev/usb uhci.c In-Reply-To: Your message of "Thu, 03 Jan 2002 20:07:52 +1100." <20020103194429.T15755-100000@gamplex.bde.org> Date: Thu, 03 Jan 2002 10:28:57 +0100 Message-ID: <831.1010050137@critter.freebsd.dk> From: Poul-Henning Kamp 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 In message <20020103194429.T15755-100000@gamplex.bde.org>, Bruce Evans writes: >Code should be written to not depend on >DELAY() being very accurate. OTOH, the i386 DELAY() could be written >better using microuptime(undoc). It would then be much simpler (except >possibly for complications to make it work at boot time), and more >accurate (except for small intervals on slow machines). I have actually thought about DELAY() a fair bit. 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. 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. Summary: a) A lot more can be done to improve things. b) Not doing so properly discourages people from using it. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message