Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!biar!jhood From: jhood@biar.UUCP (John Hood) Newsgroups: comp.arch Subject: Re: DMA on RISC-based systems Message-ID: <620@biar.UUCP> Date: 7 Jun 89 05:18:05 GMT References: <46500067@uxe.cso.uiuc.edu> <181@dg.dg.com> <1989May31.163057.543@utzoo.uucp> <3480@orca.WV.TEK.COM> <185@dg.dg.com> Reply-To: jhood@biar.UUCP (John Hood) Organization: Biar Games Inc., Ithaca, NY Lines: 49 In article <185@dg.dg.com> uunet!dg!rec (Robert Cousins) writes: >Where does the DMA pay off given that all three examples have approximately >identical throughput? > >DMA is preferable to the first choice whenever the cost of DMA is less >than 20% of the cost of the CPU or less than the cost of speeding up >the CPU by 20%. > >DMA is preferable to the second choice whenever the cost of DMA is >less than 9% of the cost of the CPU or less than the cost of speeding >up the CPU by 9%. > >I am the first to admit that these models are simplistic, but they >do represent valid considerations and reasonable approximations to >to the actual solutions. > >Comments? Robert has also ignored the cost of setting up the DMA controller, which can be significant, especially for scatter/gather type operation. Also note that with modern operating systems that do buffering or disk caching, there is going to be a bcopy or its moral equivalent in there somewhere. This doesn't reduce CPU time used during programmed I/O, but it does change the trade off from, say, 3 vs 10% to 13 vs 23% of CPU availability used for disk I/O. This makes the nature of the trade off different. My other thought is that regardless of the CPU cost, programmed I/O is often acceptable on single-user machines anyway. The situation often arises where the user is only concerned about the speed of the one process he's using interactively. That process will usually have to wait till its data arrives anyway, at least under current programming models. If the CPU has to sit and wait, it might as well do the data movement too. On the other hand, effective multi-channel DMA can be used to have several things going at once-- a bunch of disk drives, or as in the Macintosh and NeXT machines, sound in parallel with other stuff. I'm not about to make any pontifications about what I think is the best solution for the future, because I don't know myself ;-) --jh-- John Hood, Biar Games snail: 10 Spruce Lane, Ithaca NY 14850 BBS: 607 257 3423 domain: jhood@biar.uu.net bang: anywhere!uunet!biar!jhood "Insanity is a word people use to describe other people's lifestyles. There ain't no such thing as sanity."-- Mike McQuay, _Nexus_