lkml.org 
[lkml]   [2002]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: interrupt latency
On Wed, Aug 28, 2002 at 08:18:25AM -0400, Richard B. Johnson wrote:
> On Tue, 27 Aug 2002 yodaiken@fsmlabs.com wrote:
>
> > On Tue, Aug 27, 2002 at 04:44:34PM -0400, Richard B. Johnson wrote:
> > > On Tue, 27 Aug 2002 yodaiken@fsmlabs.com wrote:
> > >
>
> [SNIPPED...]B
> >
> > You can do it in a tight loop. But you cannot do it otherwise. RS232 works
> > because most UARTs have fifo buffers. Old Windows did pretty well, because
> > you could grab the machine and let nothing else happen.
> >
> > What makes me dubious about your claim is that it is easy to test
> > and see that a single ISA operation can take 18 microseconds
> > on most PC hardware.
> >
> > try:
> > cli
> > loop:
> > read tsc
> > inb
> > read tsc
> > compute difference
> > print worst case every 1000000 times.
> >
> > sti
> >
> > run for an hour on a busy machine.
> >
> >
>
> No, no, no. There is no such port read that takes 18 microseconds, even
> on old '386 machines with real ISR slots. A port read on those took

Sorry, but the numbers don't lie. It's an easy test to make.
The test you have below tests something else entirely. It tests
average time over a period of something around 1 second.


> (void)alarm(1);
> run++;
> while(run)
> {
> foo[0] = inb(0x378); /* Actually put into memory */
> count++; /* This takes as long as bumping a pointer */
> }
> printf("\nPort reads in a second = %lu\n", count);
> return 0;
> }

Average and worst case are different.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.093 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site