Chapter 7 InputOutput and Storage Systems Chapter 7

  • Slides: 41
Download presentation
Chapter 7 Input/Output and Storage Systems

Chapter 7 Input/Output and Storage Systems

Chapter 7 Objectives • Become familiar with storage media, and the differences in their

Chapter 7 Objectives • Become familiar with storage media, and the differences in their respective formats. • Understand how RAID improves disk performance and reliability. 2

7. 1 Introduction • Data storage and retrieval is one of the primary functions

7. 1 Introduction • Data storage and retrieval is one of the primary functions of computer systems. • Sluggish I/O performance can have a ripple effect, dragging down overall system performance. • This is especially true when virtual memory is involved. • The fastest processor in the world is of little use if it spends most of its time waiting for data. 3

7. 3 I/O Architectures • We define input/output as a subsystem of components that

7. 3 I/O Architectures • We define input/output as a subsystem of components that moves coded data between external devices and a host system. • I/O subsystems include: – – Blocks of main memory that are devoted to I/O functions. Buses that move data into and out of the system. Control modules in the host and in peripheral devices Interfaces to external components such as keyboards and disks. – Cabling or communications links between the host system and its peripherals. 4

7. 3 I/O Architectures This is a model I/O configuration. 5

7. 3 I/O Architectures This is a model I/O configuration. 5

7. 3 I/O Architectures • I/O can be controlled in four general ways. •

7. 3 I/O Architectures • I/O can be controlled in four general ways. • Programmed I/O reserves a register for each I/O device. Each register is continually polled to detect data arrival. • Interrupt-Driven I/O allows the CPU to do other things until I/O is requested. • Direct Memory Access (DMA) offloads I/O processing to a special-purpose chip that takes care of the details. • Channel I/O uses dedicated I/O processors. 6

7. 3 I/O Architectures This is a DMA configuration. Notice that the DMA and

7. 3 I/O Architectures This is a DMA configuration. Notice that the DMA and the CPU share the bus. The DMA runs at a higher priority and steals memory cycles from the CPU. 7

7. 3 I/O Architectures • Very large systems employ channel I/O. • Channel I/O

7. 3 I/O Architectures • Very large systems employ channel I/O. • Channel I/O consists of one or more I/O processors (IOPs) that control various channel paths. • Slower devices such as terminals and printers are combined (multiplexed) into a single faster channel. • On IBM mainframes, multiplexed channels are called multiplexor channels, the faster ones are called selector channels. 8

7. 3 I/O Architectures • Channel I/O is distinguished from DMA by the intelligence

7. 3 I/O Architectures • Channel I/O is distinguished from DMA by the intelligence of the IOPs. • The IOP negotiates protocols, issues device commands, translates storage coding to memory coding, and can transfer entire files or groups of files independent of the host CPU. • The host has only to create the program instructions for the I/O operation and tell the IOP where to find them. 9

7. 3 I/O Architectures • This is a channel I/O configuration. 10

7. 3 I/O Architectures • This is a channel I/O configuration. 10

7. 3 I/O Architectures • I/O buses, unlike memory buses, operate asynchronously. Requests for

7. 3 I/O Architectures • I/O buses, unlike memory buses, operate asynchronously. Requests for bus access must be arbitrated among the devices involved. • Bus control lines activate the devices when they are needed, raise signals when errors have occurred, and reset devices when necessary. • The number of data lines is the width of the bus. • A bus clock coordinates activities and provides bit cell boundaries. 11

Computer Buses – A bus is a common electrical pathway between multiple devices. •

Computer Buses – A bus is a common electrical pathway between multiple devices. • Can be internal to the CPU to transport data to and from the ALU. • Can be external to the CPU, to connect it to memory or to I/O devices. – Early PCs had a single external bus or system bus. – Modern PCs have a special-purpose bus between the CPU and memory and (at least) one other bus for the I/O devices.

Computer Buses

Computer Buses

Computer Buses – In order to make it possible for boards designed by third

Computer Buses – In order to make it possible for boards designed by third parties to attach to the system bus, there must be well-defined rules about how the bus works, and which all attached devices must obey. – These rules are called the bus protocol. – In addition, there must be mechanical and electrical specifications.

Computer Buses – A number of buses are in widespread use in the computer

Computer Buses – A number of buses are in widespread use in the computer world. • • • Multibus (8086) IBM PC (PC/XT) ISA bus (PC/AT) EISA bus (80386) Microchannel (PS/2) PCI bus (Many PCs) Nubus (macintosh) Universal Serial Bus (modern PCs) Fire. Wire (consumer electronics)

Computer Buses – Some devices that attach to a bus are active and can

Computer Buses – Some devices that attach to a bus are active and can initiate bus transfers. They are called masters. – Some devices are passive and wait for requests. They are called slaves. – Some devices may act as slaves at some times and masters at others. – Memory can never be a master device.

Computer Buses • The binary signals that computer devices output are frequently not strong

Computer Buses • The binary signals that computer devices output are frequently not strong enough to power a chip. – The bus may be relatively long or have several devices attached to it. – Most bus masters are connected to the bus by a chip called a bus driver which is essentially a digital amplifier. – Most slaves are connected to the bus by a bus receiver.

Computer Buses – For devices which can be both master and slave, a device

Computer Buses – For devices which can be both master and slave, a device called a bus transceiver is used. – These bus interface devices are often tri-state devices to allow them to disconnect when they are not needed. – A bus has address, data, and control lines, but there is not necessarily a one-to-one mapping between CPU pins and bus lines. A decoder chip between CPU and bus would be needed in this case.

Bus Width – The more address lines a bus has, the more memory the

Bus Width – The more address lines a bus has, the more memory the CPU can address directly. – If a bus has n address lines, then the CPU can use it to address 2 n different memory locations. – Larger buses are more expensive: • • they need more wires they take up more space on the motherboard they need bigger connectors Early PC buses did not contain enough address lines leading several backward compatible upgrades to the bus.

Bus Width

Bus Width

Bus Clocking – Buses can be divided up into two categories depending on their

Bus Clocking – Buses can be divided up into two categories depending on their clocking. – A synchronous bus has a line driven by a crystal oscillator. • The signal on this line consists of a square wave with a frequency of 5 - 100 MHz. • All bus activities take an integral number of these cycles, called bus cycles. – The asynchronous bus does not have a master clock. Bus cycles can be of any length required and need not be the same.

Bus Clocking – Consider a synchronous bus with a 40 -MHz clock, which gives

Bus Clocking – Consider a synchronous bus with a 40 -MHz clock, which gives a clock cycle of 25 nsec. – Assume reading from memory takes 40 nsec from the time the address is stable. • It takes three bus cycles to read a word. – MREQ’ indicates that memory is being accessed. RD’ is asserted for reads and negated for writes. WAIT’ inserts wait states (extra bus cycles) until the memory is finished

Bus Clocking – Although synchronous buses are easy to work with due to their

Bus Clocking – Although synchronous buses are easy to work with due to their discrete time intervals, they also have some problems. • Everything works in multiples of the bus clock. • If a CPU and memory can complete a transfer in 3. 1 cycles they have to stretch it to 4. 0 because fractional cycles are forbidden. • Once a bus cycle has been chosen, and memory and I/O cards have been built for it, it is difficult to take advantage of future improvements in technology. The bus has to be geared to the slowest devices (legacy devices) on the bus.

Bus Clocking – Mixed technology can be handled by going to an asynchronous bus.

Bus Clocking – Mixed technology can be handled by going to an asynchronous bus. – The master device asserts MREQ’, RD’, etc. and then asserts MSYN’ (Master SYNchronization). • Seeing this, the slave device starts to work. • When it is finished it asserts SSYN’ (Slave SYNchronization). • Seeing this, the master reads the data. • When it is done, it negates MREQ’, RD’, the address lines, MSYN’ and SSYN’.

Bus Clocking • This ends the read. – A set of signals that interlocks

Bus Clocking • This ends the read. – A set of signals that interlocks in this way is called a full handshake. – Full handshakes are timing independent. Each event is caused by a prior event, not by a clock cycle. – Despite the advantages of asynchronous buses, most buses are synchronous since they are easier to build, and since there is such a large investment in synchronous bus technology.

7. 3 I/O Architectures This is how a bus connects to a disk drive.

7. 3 I/O Architectures This is how a bus connects to a disk drive. 26

7. 7 RAID • RAID, an acronym for Redundant Array of Independent Disks was

7. 7 RAID • RAID, an acronym for Redundant Array of Independent Disks was invented to address problems of disk reliability, cost, and performance. • In RAID, data is stored across many disks, with extra disks added to the array to provide error correction (redundancy). 27

7. 7 RAID • RAID Level 0, also known as drive spanning, provides improved

7. 7 RAID • RAID Level 0, also known as drive spanning, provides improved performance, but no redundancy. – Data is written in blocks across the entire array – The disadvantage of RAID 0 is in its low reliability. 28

Advantages Read/Write performance inscreased by spreading the load acrros many channels adn drives No

Advantages Read/Write performance inscreased by spreading the load acrros many channels adn drives No parity calculation overhead is involved Very simple design Disadvantages Requirements Not "TRUE" RAID, RAID Level 0 requires because there is no a minimum of 2 drives fault tolerance to implement. The failure of just one drive will result in all data in an array being lost After a certain amount of drives, performance does not increase significatly. Applications Any application which requires very high speed storage, but does not need redundancy. • Video Production and Editing • Image Editing • Pre-Press Applications • Any application requiring high bandwidth 29

7. 7 RAID • RAID Level 1, also known as disk mirroring, provides 100%

7. 7 RAID • RAID Level 1, also known as disk mirroring, provides 100% redundancy, and good performance. – Two matched sets of disks contain the same data. – The disadvantage of RAID 1 is cost. 30

Advantages One Write or two Reads possible per mirrored array Twice the Read transaction

Advantages One Write or two Reads possible per mirrored array Twice the Read transaction rate of single disks, same Write transaction rate as single disks No rebuild is necessary in case of a disk failure, just another hard drive needs to be installed to replace the bad one Disadvantages Highest disk overhead of all RAID types (100%) - inefficient, 1 of 2 disks is used for redundany Storrage capacity limited to size of one hard drive. Requirements RAID Level 1 requires a minimum of 2 drives to implement, and can only have a maximum of 2 drives. Applications which require redundancy with fast random writes; entrylevel systems where only two drives are available. • SMB Domain Server • Payroll • Financial • Entry-level Web Server • Small File Server 31

7. 7 RAID • A RAID Level 2 configuration consists of a set of

7. 7 RAID • A RAID Level 2 configuration consists of a set of data drives, and a set of Hamming code drives. – Hamming code drives provide error correction for the data drives. – RAID 2 performance is poor and the cost is relatively high. 32

7. 7 RAID • RAID Level 3 stripes bits across a set of data

7. 7 RAID • RAID Level 3 stripes bits across a set of data drives and provides a separate disk for parity. – Parity is the XOR of the data bits. – RAID 3 is not suitable for commercial applications, but is good for personal systems. 33

7. 7 RAID • RAID Level 4 is like adding parity disks to RAID

7. 7 RAID • RAID Level 4 is like adding parity disks to RAID 0. – Data is written in blocks across the data disks, and a parity block is written to the redundant drive. – RAID 4 would be feasible if all record blocks were the same size. 34

7. 7 RAID • RAID Level 5 is RAID 4 with distributed parity. –

7. 7 RAID • RAID Level 5 is RAID 4 with distributed parity. – With distributed parity, some accesses can be serviced concurrently, giving good performance and high reliability. – RAID 5 is used in many commercial systems. 35

Advantages Highest Read data transaction rate Medium Write data transaction rate Good aggregate transfer

Advantages Highest Read data transaction rate Medium Write data transaction rate Good aggregate transfer rate Huge array capacity possibilites Disadvantages Disk failure can affect throughput Most complex controller design Individual block data transfer rate same as single disk Requirements RAID Level 5 requires a minimum of 3 drives to implement Applications which require increased storage capacity and higher performance. • Database Servers • File & Application servers • Intranet servers • ERP Servers • Financial • DVR Serve 36

7. 7 RAID • RAID Level 6 carries two levels of error protection over

7. 7 RAID • RAID Level 6 carries two levels of error protection over striped data: Reed-Soloman and parity. – It can tolerate the loss of two disks. – RAID 6 is write-intensive, but highly fault-tolerant. 37

Advantages Disadvantages RAID 6 is essentially an More complex controller design extension of RAID

Advantages Disadvantages RAID 6 is essentially an More complex controller design extension of RAID level 5 which Controller overhead to compute allows for additional fault parity addresses is extremely tolerance by using a second high independent distributed parity Write performance can be scheme (dual parity) brought on par with RAID Level Data is striped on a block level 5 by using a custom ASIC for across a set of drives, just like in computing Reed-Solomon parity RAID 5, and a second set of Requires N+2 drives to parity is calculated and written implement because of dual across all the drives; RAID 6 parity scheme provides for an extremely high data fault tolerance and can sustain multiple simultaneous drive failures Perfect solution for mission critical applications Requirements RAID Level 6 requires a minimum of 4 drives to implement Applications which require increased storage capacity and bullet-proof redundancy. • Database Servers • File & Application servers • Intranet servers • ERP Servers • Financial Servers • Healthcare • Government 38

7. 7 RAID • Large systems consisting of many drive arrays may employ various

7. 7 RAID • Large systems consisting of many drive arrays may employ various RAID levels, depending on the criticality of the data on the drives. – A disk array that provides program workspace (say for file sorting) does not require high fault tolerance. • Critical, high-throughput files can benefit from combining RAID 0 with RAID 1, called RAID 10. • Keep in mind that a higher RAID level does not necessarily mean a “better” RAID level. It all depends upon the needs of the applications that use the disks. 39

Chapter 7 Conclusion • I/O systems are critical to the overall performance of a

Chapter 7 Conclusion • I/O systems are critical to the overall performance of a computer system. • Amdahl’s Law quantifies this assertion. • I/O systems consist of memory blocks, cabling, control circuitry, interfaces, and media. • I/O control methods include programmed I/O, interrupt-based I/O, DMA, and channel I/O. • Buses require control lines, a clock, and data lines. Timing diagrams specify operational details. 40

Chapter 7 Conclusion • RAID gives disk systems improved performance and reliability. RAID 3

Chapter 7 Conclusion • RAID gives disk systems improved performance and reliability. RAID 3 and RAID 5 are the most common. 41