Chapters 8 (partial coverage) 1
Interfacing Processors and Peripherals • I/O Design affected by many factors (expandability, resilience) • Performance is complex: — access latency — throughput — connection between devices and the system — the memory hierarchy — the operating system Interrupts Processor Processor Cache Memory- I/O bus Main I/O I/O I/O memory controller controller controller Network Graphics Disk Disk output 2
I/O Devices • Very diverse devices — behavior (i.e., input vs. output) — partner (who is at the other end?) — data rate 3
I/O Example: Disk Drives Example Sector size: 512 bytes Average seek time: 6ms RPM: 10,000 Transfer rate: 50MB/sec Controller overhead is 0.2ms What’s the average time to read a sector for this disk? 0.5 0.5KB 6.0ms + + + 0.2ms 10,000RPM 50MB/sec = 6.0 + 3.0 + 0.01 + 0.2 = 9.2 ms • To access data: — seek: position head over the proper track (3 to 14 ms. avg.) — rotational latency: wait for desired sector (.5 / RPM) — transfer: grab the data (one or more sectors) 30 to 80 MB/sec 4
RAID: Redundant Arrays of Inexpensive Disks • Improve both performance and availability of disk storage – Performance: • By replacing a large, expensive disk with many small, inexpensive disks. • Performance is improved because many disks can operate at once. – Availability: • • Improve availability by adding redundancy with low cost. Improve availability by adding redundancy with low cost. � ��������������������� � ����������������� � ������������������������������������������� � ������������������������������� � ����� ������!�������������������� � �����"����#���$���������!�������������������� 5
RAID 0: No Redundancy • Characteristics – Striping: allocation of logically sequential blocks to separate disks – Striping data over multiple disks, automatically forces accesses to several disks, while appear to software as a single large disk. • Advantages – achieve higher performance than a single disk can deliver. • Disadvantages – No fault-tolerance because of no redundancy. 6
RAID 1: Mirroring • Characteristic – Mirroring: write identical data to multiple disks to increase data – Mirroring: write identical data to multiple disks to increase data availability – Whenever data are written to one disk, those data are also written to redundant disks, so there are always multiple copies of the information. – If a disk fails, system just goes to the “mirrored” disk to get data. • Advantage – Simplest design. • Disadvantage – Most expensive since it requires the most disks (100% redundancy). 7
RAID 2: Error Detecting and Correcting Code • Characteristic – Use Hamming code as Error Correction Code on redundant disks – No one use it already, we won’t discuss it more. 8
RAID 3: Bit-Interleaving Parity • Characteristic – Protection group: the group of disks that share a common check disk – Protection group: the group of disks that share a common check disk which stores Parity to restore lost data on a failure. – Each data block is striped on byte-level across all the disks in the protection group ( so each Read/Write goes to all disks in the group ). – Parity disk is updated on each write. • Advantage – Cost of redundancy is 1/N, ( N: number of disks in a protection group ) – Very high R/W transfer rate. • Disadvantage – Need fairly complex disk controller, to make all disk synchronized. – Cannot do multiple small Reads/Writes in parallel. 9
RAID 4: Block-Interleaving Parity • • Characteristic Characteristic – Data are striped on block-level across all disks in the protection group. – Parity are updated on each write. • Advantage – Same ratio of redundancy (1/N) as RAID3 – High data transfer rate for large Read/Write access. – Allow multiple small reads to occur in parallel. • Disadvantage – Poor Small writes performance because of bottleneck on parity disk. 10
RAID 5: Distributed Block-Interleaving Parity • • Characteristic Characteristic – Same as RAID4 except that “Parity information is spread throughout all the disks.” • Advantage – Low redundancy (1/N, same as RAID3, RAID4) – Good for large R/W – Allow multiple small R/W in parallel (no parity-write bottleneck). • Disadvantage – Complex disk controller to design 11
I/O Example: Buses • What is a Bus? • Types of buses: — processor-memory — backplane — I/O • Synchronous Bus vs. Asynchronous Bus • Bus Arbitration: Bus Arbitration: — daisy chain arbitration — centralized arbitration — collision detection • 12
What is a bus? A Bus Is: • shared communication link (one or more wires) • single set of wires used to connect multiple subsystems • A Bus is also a fundamental tool for composing large, complex systems – systematic means of abstraction 13
Buses Advantages of Bus • Versatility: By defining a single scheme, devices can be added easily • Cost-effective: A single set of wires is shared in multiple ways Disadvantages of Bus • It creates a communication bottleneck – The bandwidth of that bus can limit the maximum I/O throughput Challenge of bus design • The maximum bus speed is largely limited by: – The length of the bus – The number of devices on the bus • The need to support a range of devices with: – Widely varying latencies, Widely varying data transfer rates • It is difficult to run many parallel wires at high speed – the industry is in transition from parallel buses to high-speed serial point-to-point interconnections (or networks). 14
Types of Buses • Processor-Memory Bus (design specific) – A bus that connects processor and memory – Short and high speed – The bandwidth only needs to match the memory system so as to Maximize memory-to-processor bandwidth • I/O Bus (industry standard) – Usually is lengthy and slower – The bandwidth needs to match a wide range of I/O devices – The bandwidth needs to match a wide range of I/O devices – Not connect to memory directly, but connect to the processor- memory bus or backplane bus – e.g., IDE bus, SCSI bus, USB bus. • Backplane Bus – Allow processors, memory, and I/O devices to coexist – Cost advantage: one bus for all components – often standardized, e.g., PCI 15
A Two-Bus System Processor Memory Bus Processor Memory Bus Bus Bus Adaptor Adaptor Adaptor I/O I/O I/O Bus Bus Bus • I/O buses tap into the processor-memory bus via bus adaptors to speed match between bus types: – Processor-memory bus: mainly for processor-memory traffic – I/O buses: provide expansion slots for I/O devices • Apple Macintosh-II – NuBus: Processor, memory, and a few selected I/O devices – SCSI Bus: the rest of the I/O devices 16
A Three-Bus System (+ backside cache) Processor Memory Bus Processor Memory Bus Backside Adaptor Cache bus Bus Backplan Adaptor I/O Bus L2 Cache Bus I/O Bus ane Adaptor Bus • A small number of backplane buses tap into the processor-memory bus – Processor-memory bus focus on traffic to/from memory – I/O buses are connected to the backplane bus • Advantage: – loading on the processor bus is reduced & busses run at different speeds 17
Synchronous and Asynchronous Bus • Synchronous Bus: – Includes a clock in the control lines – A fixed protocol for communication that is relative to the clock – Advantage: involves very little logic and can run very fast – Disadvantages: • Every device on the bus must run at the same clock rate • • To avoid clock skew, they cannot be long if they are fast To avoid clock skew, they cannot be long if they are fast – Processor-memory buses are often synchronous • Asynchronous Bus: – It is not clocked – It can accommodate a wide range of devices – It can be lengthened without worrying about clock skew – It requires a handshaking protocol – Example: USB2.0 18
Arbitration: Obtaining Access to the Bus Control: Master initiates requests Bus Bus Data can go either way Master Slave • One of the most important issues in bus design: – How is the bus reserved by a device that wishes to use it? • Chaos is avoided by a master-slave arrangement: • Chaos is avoided by a master-slave arrangement: – Only the bus master can control access to the bus: • It initiates and controls all bus requests – A slave responds to read and write requests • The simplest system: – Processor is the only bus master – All bus requests must be controlled by the processor – Major drawback: the processor is involved in every transaction 19
Recommend
More recommend