Date: Mon, 3 Jul 1995 20:38:27 +1000 From: Bruce Evans <bde@zeta.org.au> To: freebsd-current@freefall.cdrom.com, hsu@clinet.fi Subject: Re: kern/579: sio: RS_IBUFSIZE 256 too small Message-ID: <199507031038.UAA14048@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>My workaround is apparently wrong, it works as I don't need and don't have >rts/cts flow control, but clearly something needs to be done to sio in this >respect. 256 bytes seems overly tight to me, moving data in pieces this >small is waste of cpu. Does it need to do a context switch or interrupt >for each time it loads the 256 byte buffer to a tty buffer? Only a software interrupt. Since the driver has to handle a hardware interrupt for every 1 or 14 characters, and a software interrupt has less overhead than a hardware interrupt (at least for FreeBSD on i386's), 256 bytes is plenty bug enough. The normal amount is actually only 115.2 bytes at 115200 bps or 1.2 bytes at 1200 bps (the multi-level interrupt handler certainly isn't more efficient at 1200 bps!). 256 was chosen as big enough to handle 115200 bps when the interrupt-level buffer is transferred every clock tick. Transferring it less often would give an unacceptable latency for non-streaming protocols. 128 would have been too close to 115.2. I thought that softclock() interrupts were never delayed as long as 1 clock tick except on grossly overloaded systems. But they sometimes are. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507031038.UAA14048>