Introduction to I/OI/O is slow!Common I/O devicesHard drivesNetworksI/O PerformanceBack of the Envelope CalculationAccessing data on a hard diskEstimating seek timeEstimating rotational delayEstimating transfer timeParallel I/OComputer busesHierarchical busesBasic bus protocolsWhat is the bus anyway?Multiplexed bus linesExample bus problemsExample Bus Problems, cont.Synchronous and asynchronous busesBuses in modern PCsPCIFrequenciesThe North BridgeExternal busesThe Serial/Parallel conundrum1Introduction to I/OComputers communicate with the outside world via I/O devices—Input devices supply computers with data to operate on—Results of computations can be sent to output devicesThere are two main ingredients to I/O systems—Devices: e.g. hard drives, CD drives, keyboards, printers, display—Buses: these connect devices to each other and to the processorToday and Friday we’ll talk about I/O system issues—I/O performance affects the overall system speed—We’ll look at some common devices and factors affecting their performance—We’ll look at how I/O devices are connected: by buses2I/O is slow!How fast can a typical I/O device supply data to a computer?—A fast typist can enter 9-10 characters a second on a keyboard—Common local-area network (LAN) speeds go up to 100 Mbit/s, which is about 12.5MB/s—Today’s hard disks provide a lot of storage and transfer speeds around 40-60MB per secondUnfortunately, this is excruciatingly slow compared to modern processors and memory systems:—Modern CPUs can execute more than a billion instructions per second—Modern memory systems can provide 2-4 GB/s bandwidthI/O performance has not increased as quickly as CPU performance, partially due to neglect and partially to physical limitations—This is changing, with faster networks, better I/O buses, RAID drive arrays, and other new technologies3Common I/O devicesHard drives are almost a necessity these days, so their speed has a big impact on system performance:—they store programs, media, etc.—Virtual memory systems: hard disk acts as a large (but slow) part of main memoryNetworks are also ubiquitous nowadays—access to data from around the world—Hard disks can act as a cache for network data! For example, web browsers often store local copies of recently viewed web pagesMany computing tasks are I/O-bound, and the speed of the input and output devices limits the overall system performance (Amdahl’s Law)4Hard drivesFigure 8.4 in the textbook shows the ugly guts of a hard disk—Data is stored on double-sided magnetic disks called platters—Each platter is arranged like a record, with many concentric tracks—Tracks are further divided into individual sectors, which are the basic unit of data transfer—Each surface has a read/write head like the arm on a record player, but all the heads are connected and move togetherA 75GB IBM Deskstar has roughly:—5 platters (10 surfaces),—27,000 tracks per surface,—512 sectors per track, and—512 bytes per sectorPlatterTrackPlattersSectorsTracks5ping www.uiuc.edu : time=0.275 msping www.stanford.edu: time=68.4 msping www.tu-berlin.de: time=140 msping www.uiuc.edu : time=0.275 msping www.stanford.edu: time=68.4 msping www.tu-berlin.de: time=140 msNetworksWhen communicating over a network, data is broken into a collection of “packets”Internet:—Each packet carries ~1kB of data—Packets are reassembled into the original message at the destinationIt takes time for bits to travel across states, countries and oceans!6There are two fundamental performance metrics for I/O systems:1. Latency: the time taken for the smallest transfer (units = time)—This is a primary concern for programs that do many small dependent transfers2. Bandwidth: the amount of data that can be transferred in unit time (units = bytes/time) —This is a primary concern for applications which transfer large amounts of data in big blocks—If you download large files over Kazaa, bandwidth will be the limiting factorI/O Performance7Back of the Envelope CalculationBecause data transmission can be pipelined, the total time to get data can be estimated as:Time = latency + transfer_size / bandwidth sec bytes / (bytes/sec)Dominant term forsmall transfersDominant term forlarge transferslatency8Accessing data on a hard diskAccessing a sector on a track on a hard disk takes a lot of time!Factors affecting latency:—Seek time measures the delay for the disk head to reach the track—A rotational delay accounts for the time to get to the right sectorFactors affecting bandwidth:—The transfer time is how long the actual data read or write takes. We usually assume that the disk can read/write as fast as it can spin. Thus, the transfer time is determined by the rotational speed (measured in revolutions per minute or RPM), which also determines the rotational delay9Estimating seek timeManufacturers often report average seek times of 8-10ms—These times average the time to seek from any track to any other trackIn practice, seek times are often much better—For example, if the head is already on or near the desired track, then seek time is much smaller. In other words, locality is important!—Actual average seek times are often just 2-3ms10Estimating rotational delayOnce the head is in place, we need to wait until the right sector is underneath the head—This may require as little as no time (reading consecutive sectors) or as much as a full rotation (just missed it)—On average, for random reads/writes, we can assume that the disk spins halfway on averageRotational delay depends on how fast the disk platters spin:Average rotational delay = 0.5 rotations / rotations per minute—For example, a 5400 RPM disk has an average rotational delay of:0.5 rotations / (5400 rotations/minute) = 5.55msThe average latency is the sum of the average seek time and the average rotational delay11Estimating transfer timeAssume a disk has the following specifications—An average seek time of 11ms—A 5400 RPM rotational speed—A 10MB/s average transfer rateHow long does it take to read a random 1,024 byte sector?—The average rotational delay is 5.55ms—Thus, the average latency is 11 + 5.55 = 16.55msThe transfer time will be about (1024 bytes / 10 MB/s) = 0.1msIt thus takes 16.55ms + 0.1ms = 16.7ms to read a random sector—That’s 16,700,000 cycles for a 1GHz
View Full Document