[lug] 16550 Serial port buffering?

D. Stimits stimits at idcomm.com
Sun May 27 02:35:11 MDT 2001


Alan Robertson wrote:
> 
> "D. Stimits" wrote:
> >
> > "Scott A. Herod" wrote:
> > >
> > > After 3 days of trying to get it to work....
> > >
> > >   "man setserial"  search for low_latency.
> >
> > Makes me wonder if this could have a beneficial effect on the serial
> > port of a 56k modem while working with games that require low latency.
> > When I get around to it, I think I'll give it a try (not exactly serious
> > work, but hey, someone needs to be less serious).
> >
> > D. Stimits, stimits at idcomm.com
> >
> > >
> > > Apparently it was the serial port driver, not context switching
> > > in the kernel.
> > >
> > > Scott
> > >
> > > "Scott A. Herod" wrote:
> > > >
> > > > Hello,
> > > >
> > > >   We're having a hard time getting rapid response from a clock attached
> > > > to the 16550 serial port on my machine.  This is RH 7.1 with the
> > > > 2.4.2 kernal.  We believe that we're seeing a big delay ( on the order
> > > > of 10 msecs ) between the time the clock sends a byte and the
> > > > time that select in a user-land process returns with that byte.
> > > >
> > > >   A couple of questions:
> > > >
> > > >   Is this an indication of context switching and if so is it possible
> > > > to speed it up?
> > > >
> > > >   Is there a way to trigger another line on the serial port when the
> > > > read occurs so that I can watch a scope to verify that I am getting
> > > > this delay?
> > > >
> > > >   Any other thoughts would be greatly appreciated.
> 
> The Linux kernel has latency problems.  There is a series of patches called
> "low latency" patches for the kernel which are supposed to address that.
> 
> They aren't in any distribution yet.  Andi Kleen says this about them:
> 
> > The problem with the low latency stuff is that it slows things down (noticeable
> > in benchmarks and under heavy loads because of more context switches) and
> > tends to trigger new bugs.  This means users must be warned at least,
> > otherwise there will be e.g. benchmark tests run on it.
> 
> You might look here for a set of such patches...
> 
> http://people.redhat.com/mingo/lowlatency-patches/
> 
>         -- Alan Robertson
>            alanr at unix.sh
> 

I wasn't actually considering RT Linux patches. I was just wondering if
it would be possible to squeak out a slightly more responsive modem with
the existing setserial low_latency option...i.e., the maximum possible
with stock tools. But if an average ping time is something like 200 ms,
and the option offers maybe a 10 ms improvement, it is possible that an
unsaturated modem could gain about 5% responsiveness in a game. I don't
know if 5% would be noticeable, nor how badly it would hurt things if
the modem was already near max bandwidth (I assume low latency causes
more smaller packets to go out and thus less efficient since more
headers would waste bandwidth for the same amount of data).

D. Stimits, stimits at idcomm.com



More information about the LUG mailing list