Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Jan 2002 22:48:50 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Mike Silbersack <silby@silby.com>
Cc:        Bruce Evans <bde@zeta.org.au>, freebsd-arch@FreeBSD.ORG
Subject:   Re: DELAY accuracy Re: cvs commit: src/sys/dev/usb uhci.c 
Message-ID:  <2971.1010094530@critter.freebsd.dk>
In-Reply-To: Your message of "Thu, 03 Jan 2002 16:35:40 EST." <Pine.BSF.4.30.0201031624120.45843-100000@niwun.pair.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.30.0201031624120.45843-100000@niwun.pair.com>, Mike Silb
ersack writes:

>I'm not actually concerned about DELAY() calls being accurate for the sake
>of the device drivers using such calls, but rather for the sake of rest of
>the OS; if a call to DELAY(1) in some commonly called interrupt handler is
>really taking 8us, that's 7us of extra interrupt latency that we could
>save.

If we look at DELAY(1), which is a very common value, considering
the typical use, I suspect it may actually be specified not for the
delay as much for various "things to happen", things which might be
better provoked by memory barriers or similar.

Either way, in i386 I think DELAY(1) would be best implemented as
	inb(0x80)

Arguments for DELAY of 1msec and higher should be converted to
tsleep() + HZ=1000.

-- 
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




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