From owner-freebsd-hardware Sun Jun 30 12:17:28 1996 Return-Path: owner-hardware Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA07801 for hardware-outgoing; Sun, 30 Jun 1996 12:17:28 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id MAA07794 for ; Sun, 30 Jun 1996 12:17:23 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id FAA24422; Mon, 1 Jul 1996 05:13:18 +1000 Date: Mon, 1 Jul 1996 05:13:18 +1000 From: Bruce Evans Message-Id: <199606301913.FAA24422@godzilla.zeta.org.au> To: Brett_Glass@ccgate.infoworld.com, bde@zeta.org.au, hdalog@zipnet.net, msmith@atrad.adelaide.edu.au Subject: Re: muliport boards - building a PPP dialup server Cc: Kevin_Swanson@BLaCKSMITH.com, chuckr@glue.umd.edu, freebsd-hardware@FreeBSD.org, jparnas@jparnas.cybercom.net Sender: owner-hardware@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >> This is below the breakeven point. >Only if you assume no other interrupt-driven I/O is going on, and that >no other code has critical sections where interrupts are masked (or where >task switches don't happen, so that the TTY driver's buffers in RAM can't >be emptied). This is a good assumption. In FreeBSD, sio and cy interrupts have priority over all other interrupts. There is a problem if there are multiple serial boards of different capabilities on separate interrupts or under separate drivers (e.g., a 16-port 16550 board would starve a 1-port 8250 board). There would be problems if other drivers had high priority interrupt handlers. Then it might be necessary to prioritize or fairly schedule the interrupt handlers. This would normally involve returning from each interrupt handler after doing as little as possible to give the scheduler a chance to pick the highest priority interrupt. >Add moderate to heavy disk I/O and things can REALLY break down. You may Nope. In FreeBSD, disk i/o has no effect on serial interrupt handling in FreeBSD (except DMA may steal cycles). >recall that, a few months ago, I had to rewrite parts of the wd drivers >to disable a hard disk's "sleep" feature, and discovered that they busy >wait -- the maximum wait is several seconds, in fact -- in the kernel. >This can cause FIFO overruns in the TTY drivers if not in the UARTs. Certainly not in the UARTs. There's nothing special about the serial drivers here (except that their lowest level will keep working). The wd driver may interrupt any interrupt handler except the clock interrupt handler. It increases the interrupt mask to the union of bio_imask and the previous mask. If it then busy-waits, it blocks disk interrupts and everything that is already masked. Lossage is most likely for network input at 100 Mb/s. Tty input will most likely be lost due to applications not being able to run to read the tty buffers. >Thus, when in doubt, I always go for extra buffering. I have been using a >Hayes ESP (the old one, whose 1K receive buffers are hidden) on the busiest >ports to provide an extra margin of safety. With the MTU set to about 500 >characters, two whole PPP packets can fit in time of need. This won't make much difference under FreeBSD. It may even be harmful. The pseudo-dma buffers are sized suitably for 16550s. If the UART's fifo is larger than about 128, then the pseudo-dma buffers won't be able to take all the input. Flow control may fix the problem in practice (just like it does for a modem with a bug buffer connected to a UART with a small fifo). OTOH, hugh tty buffers are necessary if the system is swapping heavily or is running many hog processes. E.g., with 100 hog processes running for 1/10 second each, you need 10 seconds worth of buffering - 115 KB tty buffers! The default tty buffer size of 1KB isn't even enough for one hog process. Flow control may fix this problem in practice. Bruce