Newsgroups: comp.arch
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: Sw vs. Hw BitBlit.
Message-ID: <1988Aug12.192541.4557@utzoo.uucp>
Organization: U of Toronto Zoology
References: <399@ma.diab.se> <1988Jul28.173301.7275@utzoo.uucp> <840@stride.Stride.COM> <5493@nsc.nsc.com>
Date: Fri, 12 Aug 88 19:25:41 GMT

In article <5493@nsc.nsc.com> stevew@nsc.UUCP (Steve Wilson) writes:
>>The result is that DMA processors are a loss except to the sales
>>department.   
>
>If your only moving one byte of data between interupts to the CPU
>telling him you've moved some data, then your right.  A DMA controller
>is a WIN when you can tell it to move a large fixed length piece of data
>and then forget about it and go do something else...  [In an example] the
>processor could handle about 7000 interupts/sec.  How ya gonna do
>19.2Kb of constant data flow across 12 channels with that kind of interupt 
>response time.  DMA was a cheap answer...

I think you've missed the point slightly.  Clearly, for high data rates
it is necessary to have buffering of some kind, to keep the latency
requirements down to the point where the CPU can satisfy them.  One way
of doing that is to have the device DMA into memory.  Another way is to
put buffering on board, but have the CPU do the actual transfer into
memory when a reasonable amount of data has accumulated.  Actual timings
in several cases have clearly shown that buffered devices with CPU data
movement can beat DMA devices.  The main reason is that in many systems,
the CPU normally has possession of the bus and the DMA device must first
throw the CPU off.  There can be quite substantial overhead in doing so,
and if the DMA device then transfers a few bytes and goes away again,
the bus-ownership-transfer overhead can hurt throughput badly.  For a
modern CPU which can move data quickly, it is worth considering using
buffering instead of DMA in the peripherals.  (Side benefits are that
it makes the drivers simpler, and it's much more flexible -- most DMA
schemes can't do things like putting network headers down in one place
and the actual packet data down in another, or calculating an IP checksum
as the data is being moved.)
-- 
Intel CPUs are not defective,  |     Henry Spencer at U of Toronto Zoology
they just act that way.        | uunet!attcan!utzoo!henry henry@zoo.toronto.edu