GATE / CS ARCHIVE

GATE CSE 1996 / QUESTION 25

CPU overhead of continuous DMA transfers

Computer Organization & Architecture · Input/Output, DMA & Interrupts · Full GATE CSE 1996 paper

GATE 1996, Q25 5 marks · Descriptive
Report issue

Input/Output, DMA & Interrupts

Question 25, GATE 1996: A 50 MHz processor uses DMA for a disk transferring 2000 Kbytes/s continuously. The average DMA block is 4 Kbytes. Each transfer needs 1000 processor cycles for setup and 500 processor cycles for its completion interrupt. What fraction of CPU time is consumed by disk handling?
Tap to enlarge
Answer & solution

Answer: 0.015 of processor time, i.e. 1.5%. (no official key was published)

First count transfers rather than bytes: 2000 Kbytes/s divided by 4 Kbytes/transfer is 500 transfers/s. The same meaning of K occurs in both quantities and cancels, so decimal versus binary K does not change this rate.

The processor performs 1000+500=1500 cycles of administrative work for every transfer. At 500 transfers/s this costs 750,000 CPU cycles/s. A 50 MHz processor supplies 50,000,000 cycles/s, so the fraction used is 750,000/50,000,000=0.015, or 1.5 percent.

An equivalent time calculation checks the units. Each processor cycle lasts 1/(50×106) s=20 ns. Setup takes 20 microseconds and the completion handler takes 10 microseconds, totaling 30 microseconds per transfer. Transferring 4K bytes at 2000K bytes/s takes 0.002 s=2 milliseconds; 30 microseconds/2 milliseconds again equals 0.015. The transfer uses DMA, so the CPU is not charged for executing an instruction per byte. The calculation counts only the specified setup and completion overhead; additional bus-contention stalls, queuing effects, or other driver costs are not given and should not be invented. The statement that the disk transfers continuously fixes the block rate at its full throughput.

Original paper, page 10