[comp.sys.amiga] DMA or polling

raz%kilowatt@Sun.COM (Steve -Raz- Berry) (08/09/89)

Followups to c.s.a.t please...

In article <8908072207.AA14796@jade.berkeley.edu> 451061@UOTTAWA.BITNET (Valentin Pepelea) writes:
>Christoph Brand <wizard@accsys.uucp> writes in Message-ID: <437@accsys.UUCP>
>
>> I use now a 2090a, and I don't have ANY problems with it; even with a
>> normal ST506 drive, it is AS FAST as the GVP with a Quantum 40S;
>
> [stuff deleted about comparing a GVP to a 2090]
>
>The net result is that the processor therefore spends less time on the data
>transfer and is available more often for other concurrent tasks. Unfortunately
>this means that there are two transfers occurring, a slow DMA from hard disk
>to the cache, and a fast CPU transfer from the cache to internal memory. Other
>controllers such as the A2090 and HardFrame DMA directly from the harddrive
>into internal memory, thus tying up you CPU much longer.

	Yikes! I'm sorry, but I TOTALLY disagree with you on this one.
Logicly, if you look at the time to complete a given task, based only
on the number of bus cycles it takes to transfer a given block of data,
DMA will always win. Period. Unless of course your DMA circuitry is
totally braindead.

	Let's look at a typical bus cycle for the GVP or any polled
device. First, your device driver has to find out that data is waiting
to be transfered, in either a DMA or polled transfer this is likely to
be a similar amount of overhead. Secondly the data must be transfered.
To do this a polled device has to perform at least three bus cycles.
One to fetch the data, two to transfer the data to it's new
destination and three to decrement and branch to the top of the loop
again. This of course is the absolute minimum for the loop.

	If you now look at what the DMA card is doing, you'll see that
the Hardframe (for example) already knows where the data is supposed
to go, so it requests the Amiga bus, and directly addresses the destination
block of memory and deposits the data there. For every bus cycle following
this one, data is being written into memory. You get maximum efficiency
on the Amiga bus, where it really counts.

	Now comparing the two, what do you see? I see a maximum transfer
rate of 3 cycles/word on the GVP and 1 cycle/word on the Hardframe.
With the probability of a lot more over head on the software transfer
side.

	As for the downside of the DMA approach, you do lock out the
CPU from doing anything else except for internal cycles (a mult for 
example) But my argument is, that you spend 2/3 *less* time doing the
transfer, so you are giving all of that processor time back to the
CPU.

>So if you multitask a lot, you'll want the GVP controller, otherwise the other
>controllers are for you. Retry the diskperf benchmark again with a few CPU
>intensive programs in the background, you'll see what I mean. Now you know why
>all the CS and EE types here on Usenet recommend GVP while the doof dummkopfen
>in Deutschland recommend the rest.

	Rediculous! Your argument sounds like "Give the processor more
to do and you will multi-task better". Sorry, this is one EE type that
just won't believe it. The Amiga is a DMA machine, that is part of
what gives it it's amazing speed for graphics and sound.

>Valentin
>The godess of democracy? "The           Name:   Valentin Pepelea
>tyrants may destroy a statue,           Phonet: (613) 231-7476
>but they cannot kill a god."            Bitnet: 451061@Uottawa.bitnet
>                                        Usenet: Use cunyvm.cuny.edu gate
>                   - Confucius          Planet: 451061@acadvm1.UOttawa.CA

	Sorry if I sound so vehement on this topic, but I just couldn't
leave that common (at least these days) misconception untouched. If I
were to recommend a hard disk controller to someone who is looking for
raw speed, without any side affects, I would recommend the Hardframe.

[this is part of my effort to insure a "kinder and gentler" netdome]
---
Steve -Raz- Berry     Disclaimer: It wasn't me! I was volatilizing my esters.
UUCP: sun!kilowatt!raz                   ARPA: raz%kilowatt.EBay@sun.com
KILOWATT: sun!kilowatt!archive-server    archive-server%kilowatt.EBay@sun.com