From owner-freebsd-hardware Sun Jun 30 10:32:23 1996 Return-Path: owner-hardware Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id KAA29552 for hardware-outgoing; Sun, 30 Jun 1996 10:32:23 -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 KAA29546 for ; Sun, 30 Jun 1996 10:32:20 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id DAA21416; Mon, 1 Jul 1996 03:31:11 +1000 Date: Mon, 1 Jul 1996 03:31:11 +1000 From: Bruce Evans Message-Id: <199606301731.DAA21416@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 actually the weakest point in the sio driver. Polling 16 >> ports wastes a lot of time when only a few of them are active, and I >> think processing multiple ports per interrupt is relatively rare even >> when many of them are active. >It's not rare when it MATTERS -- that is, when the FIFOs are filling up. Even this (extremely rare) case is close to the breakeven point. Assume that input is continually arriving on 16 ports at once and that the fifo full events are independently randomly distributed (a fairly good assumption and the worst case). Assume that output is continually going out on 16 ports at once and the output completion events are independently randomly distribution (a fairly bad assumption). Assume no modem status change events (a fairly good assumption). Assume that the system is a 486 or better on a slow ISA bus (worst case for the bus). Then handling a fifo full event (for 14 chars of input) takes about 45us and handling an output completion event (for 16 chars of new output) takes about 30us. At 115200 bps, 14 characters take about 1215us to arrive,and 16 characters take about 1389us to output, so the combined chance of a fifo full or output completion event occurring while a previous fifo full event was being handled is: 1 - ((1215 - 45) / 1215)^16 * ((1389 - 45) / 1389)^16 = 0.68 Polling for this has an average cost of about 10 us. Returning from the interrupt handler and taking another interrupt immediately (if the edge trigger braindamaged didn't prevent it :-() costs 5-10us. The average busy case probably has considerably fewer than 16 fully active ports at 115200 bps. (It must have fewer than 16 fully active ports - handling fifo full events alone for 16 ports takes 16 * 45 = 720us = more than half the CPU. Handling output completion events would take the other half of the CPU.) If only input is occurring on only 8 ports then the combined chance is: 1 - ((1215 - 45) / 1215)^8 = 0.27 This is below the breakeven point. Bruce