1 / 20

CS241 I/O Revisited

CS241 I/O Revisited. Lawrence Angrave DMA, Polling, Disk Characteristics. Today. Networking Quiz DMA vs Polling Disk Characteristics Announcements. DMA & I/O. What is DMA? Why is useful? How does it work? Compare it Polling?. DMA. Direct Memory Access

Download Presentation

CS241 I/O Revisited

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS241I/O Revisited Lawrence Angrave DMA, Polling, Disk Characteristics

  2. Today • Networking Quiz • DMA vs Polling • Disk Characteristics • Announcements

  3. DMA & I/O • What is DMA? • Why is useful? • How does it work? • Compare it Polling?

  4. DMA • Direct Memory Access • DMA controls exchange of data between main memory and I/O module • Processor issues a request for transfer of block data • Process is interrupted when DMA request completes

  5. Main Advantages? Processor can perform useful work (does not need to wait for I/O device to be ready) Optimal use of memory bus: • Efficient block transfer • Use main system bus once per word (In some architectures)

  6. Cycle stealing • DMA takes control of system bus to write to main memory • CPU can not use bus at the same time • DMA has stolen cycles from the CPU!

  7. Compare to Polling • CPU continually checks I/O device to see if it is ready • Wastes CPU (and bus) cycles • So when would Polling be useful?

  8. Polling vs DMA DMA overhead: Issuing commands to DMA DMA shared resource: Requests are queued DMA efficient for block reads to memory. Interrupt overhead.

  9. Reasons for polling • Want small amount of data to be processed by CPU as soon as it is available. • Interrupt-driven I/O not available. • Not all devices, architectures support DMA transfer (or have a DMA)

  10. Speed of I/O transfer • Limitations of physical device • Limitations of I/O bus • Limitations of system bus • Limitations of read/write speed of memory

  11. Speed of I/O transfer • Limitations of physical device • Limitations of I/O bus • Limitations of system bus • Limitations of read/write speed of memory

  12. In practice • Physical device is a shared resource • So is memory, I/O bus, system bus, memory & CPU

  13. Physical device • Rotation speed • Seek time to correct track (move head to correct track)

  14. To use these • # Sectors per track • # Bytes per sector

  15. Rotation • How long before first byte is under the head? • How many milliseconds before all bytes are read from that track?

  16. HW Problem • rotational speed of 15,000 rpm, • 512 bytes per sector, • 400 sectors per track and • 1000 tracks on the disk, • average seek time is 4ms.

  17. What is the transfer time for this file? • What is the average access time for this file? • What is the rotational delay in this case? • What is the total time to read 1 sector? What is the total time to read 1 track?

  18. rpm=revolutions per minute • Transfer rate= Bytes per 360 degrees x Rotational speed (60 x rpm) • Avg Access Time for 1 sector=seek time + avg. rotational delay + transfer time for 1 sector

  19. Examples b=number of bytes to transfer, r=rotation speed, and N = number of bytes on a track Tt=transfer time = b/(rN) Ta=average access time of the whole file = Tseek+ 1/(2r)+T Average Rotational delay = 0.5/r

  20. Annoucements • HW2 due Wednesday 05/02/2007 • Newsgroup request for review lecture

More Related