Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jul 1996 03:31:11 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        Brett_Glass@ccgate.infoworld.com, bde@zeta.org.au, hdalog@zipnet.net, msmith@atrad.adelaide.edu.au
Cc:        Kevin_Swanson@BLaCKSMITH.com, chuckr@glue.umd.edu, freebsd-hardware@FreeBSD.org, jparnas@jparnas.cybercom.net
Subject:   Re: muliport boards - building a PPP dialup server
Message-ID:  <199606301731.DAA21416@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606301731.DAA21416>