182.092 Chapter 6
182.092 Chapter 6
Adapted from
Computer Organization and Design, 4th Edition,
Patterson & Hennessy, © 2008, Morgan Kaufmann Publishers
and
Mary Jane Irwin (www.cse.psu.edu/research/mdl/mji)
Processor Devices
Control Output
Memory
Datapath Input
Memory
Main
Cache
Secondary
Memory
(Disk)
60
40
20
0
1983 1990 1994 1998 2003
Year of Introduction
1 0 1 0 1
(odd)
⊕ disk fails bit parity disk
block
parity disk
Cost of higher availability still only 1/N but the parity is
stored as blocks associated with sets of data blocks
Four times the throughput (striping)
# redundant disks = 1 # of protection groups
Supports “small reads” and “small writes” (reads and writes that
go to just one (or a few) data disk in a protection group)
- by watching which bits change when writing new information, need
only to change the corresponding bits on the parity disk
- the parity disk must be updated on every write, so it is a bottleneck
for back-to-back writes
Can tolerate limited disk failure, since the data can be
reconstructed
182.092 Chapter 6.22 Herbert Grünbacher, TU Vienna, 2010
Small Writes
RAID 3 writes
New D1 data
D1 D2 D3 D4 P
⊕
3 reads and
2 writes
involving all D1 D2 D3 D4 P
the disks
D1 D2 D3 D4 P
⊕
2 reads and ⊕
2 writes
involving just
D1 D2 D3 D4 P
two disks
182.092 Chapter 6.23 Herbert Grünbacher, TU Vienna, 2010
RAID: Level 5 (Distributed Block-Interleaved
Parity)
Cost of higher availability still only 1/N but the parity block
can be located on any of the disks so there is no single
bottleneck for writes
Still four times the throughput (striping)
# redundant disks = 1 # of protection groups
Supports “small reads” and “small writes” (reads and writes that
go to just one (or a few) data disk in a protection group)
Allows multiple simultaneous writes as long as the
accompanying parity blocks are not located on the same disk
Can tolerate limited disk failure, since the data can be
reconstructed
182.092 Chapter 6.24 Herbert Grünbacher, TU Vienna, 2010
Distributing Parity Blocks
RAID 4 RAID 5
5 6 7 8 P1 5 6 7 P1 8
Time
9 10 11 12 P2 9 10 P2 11 12
13 14 15 16 P3 13 P3 14 15 16
Processor Devices
Control Output
Memory
Datapath Input
Interrupts
Processor
Cache
Graphics Network
Disk Disk
8 orders of magnitude
Mouse input human 0.0038
Laser printer output human 3.2000
range
Magnetic disk storage machine 800.0000-3000.0000
Graphics display output human 800.0000-8000.0000
Network/LAN input or machine 100.0000-
output 10000.0000
Serial ATA cables (red) are much thinner than parallel ATA
cables (green)
182.092 Chapter 6.36 Herbert Grünbacher, TU Vienna, 2010
Asynchronous Bus Handshaking Protocol
Output (read) data from memory to an I/O device
ReadReq 1
2
Data addr data
3
Ack 4 6
5 7
DataRdy
I/O device signals a request by raising ReadReq and putting the addr on
the data lines
1. Memory sees ReadReq, reads addr from data lines, and raises Ack
2. I/O device sees Ack and releases the ReadReq and data lines
3. Memory sees ReadReq go low and drops Ack
4. When memory has data ready, it places it on data lines and raises DataRdy
5. I/O device sees DataRdy, reads the data from data lines, and raises Ack
6. Memory sees Ack, releases the data lines, and drops DataRdy
7. I/O device sees DataRdy go low and drops Ack
182.092 Chapter 6.37 Herbert Grünbacher, TU Vienna, 2010
Key Characteristics of I/O Standards
Firewire USB 2.0 PCIe Serial ATA SA SCSI
Use External External Internal Internal External
Devices 63 127 1 1 4
per
channel
Max length 4.5 meters 5 meters 0.5 meters 1 meter 8 meters
Data Width 4 2 2 per lane 4 4
Peak 50MB/sec 0.2MB/sec 250MB/sec 300MB/sec 300MB/sec
Bandwidth (400) (low) per lane
100MB/sec 1.5MB/sec (1x)
(800) (full) Come as
60MB/sec 1x, 2x, 4x,
(high) 8x, 16x,
32x
Hot Yes Yes Depends Yes Yes
pluggable?
Exception
Interrupt
MIPS Status register
enable
mode
User
level
Interrupt mask
15 8 4 1 0
- Determines who can interrupt the processor (if Interrupt enable is 0,
none can interrupt)
MIPS Cause register
Branch Pending Exception
delay interrupts codes
31 15 8 6 2
- To enable a Pending interrupt, the correspond bit in the Interrupt
mask must be 1
- Once an interrupt occurs, the OS can find the reason in the
Exception codes field
182.092 Chapter 6.44 Herbert Grünbacher, TU Vienna, 2010
Interrupt Handling Steps
1. Logically AND the Pending interrupt field and the Interrupt mask
field to see which enabled interrupts could be the culprit. Make
copies of both Status and Cause registers.
2. Select the higher priority of these interrupts (leftmost is highest)
3. Save the Interrupt mask field
4. Change the Interrupt mask field to disable all interrupts of equal or
lower priority
5. Save the processor state prior to “handling” the interrupt
6. Set the Interrupt enable bit (to allow higher-priority interrupts)
7. Call the appropriate interrupt handler routine
8. Before returning from interrupt, set the Interrupt enable bit back to
0 and restore the Interrupt mask field