37
I/O Chapter 8

I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Embed Size (px)

Citation preview

Page 1: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

I/O

Chapter 8

Page 2: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Outline

• Introduction - 8.1

• Disk Storage and Dependability – 8.2

• Buses and other connectors – 8.4

• I/O performance measures – 8.6

Page 3: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Input / Ouput devices

• Communicate between human and computer– keyboard, mouse, printer, game controllers, …

• Store more than what is on processor– hard drive, thumb drive, …

• Enhanced functionality– music, video, …

Page 4: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Constraints

• Users intolerant of lost data

• Unknown (non-standard) devices

• Slow devices (relatively speaking)

Page 5: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Goals

• Dependability

• Expandability

Page 6: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Taxonomy

• Behavior – – Input (read once)– Output (write once, never read)– Storage (read / write / carries state)

• Partner– Human or machine on other side?

• Data rate (speed)– peak data transfer rate

Page 7: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Measures of Performance

• Response time – latency – time a user must wait for task

• Bandwidth– I/O operations per unit time– Data transferred per unit time

Page 8: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Outline

• Introduction - 8.1

• Disk Storage and Dependability – 8.2

• Buses and other connectors – 8.4

• I/O performance measures – 8.6

Page 9: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Anatomy of a Disk Drive

Page 10: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Vocabulary

• Head – the device that reads data from a disk• Each disk is divided into ________ _______

called _________• Each track is made up of _________• cylinder – volume of all _______ that lie under the

heads at a given point on all surfaces• nonvolatile – data that remains even when ______

is removed

Concentric circlestracks

sectors

tracks

power

Page 11: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Vocabulary

• seek – the act of positioning the _____ over the correct ________

• rotational delay or latency – average latency to rotate disk to put the ______ over the correct _______

• transfer time – time required to _________ a block of data

• disk controller – controls disk accesses

headtrack

headsector

send / receive

Page 12: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Example 1 - Performance

• What is the average time to read or write a 512-byte sector for a typical disk rotating at 10,000 RPM? The advertised average seek time is 6 ms, the transfer rate is 50 MB/sec, and the controller overhead is 0.2 ms. Assume that the disk is idle, so that there is no waiting time.

Page 13: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

• seek time: 6ms

• rotational delay: ½ rev * 1min / 10,000 rev

• transfer time: 512 B * 1 sec / 50*1024*1024 B

• controller overhead = 0.2ms

• 6ms + 3ms + 0.01ms + 0.2ms = 9.21ms

Page 14: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Reliability

• Reliability – measure of a continuously working system

• Availability – how often, on average, the system is working properly

• MTTF – Mean Time to Failure• MTTR – Mean Time to Repair• MTBF – Mean time between failures

Page 15: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Availability

• Availability – how often, on average, the system is working properly

• Availability = MTTF / (MTTF + MTTR)

Page 16: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Improving MTTF

• Fault avoidance

• Fault tolerance

• Fault forecasting

preventing fault occurrence by construction

using redundancy to continue executing in thepresence of faults (usually hardware faults)

predicting the presence and creation of faults(hardware & software faults)

Page 17: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

RAID - Redundant Arrays of Inexpensive Disks

• Shift from one large disk to several small disks

• Cheaper, smaller, faster

• Inherently less reliable

• Provide redundancy to counteract lower reliability

Page 18: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

RAID 0

• No redundancy!!!

• Only a performance increase

• Striping (interleaving) – allocation of logically sequential blocks to separate disks to increase performance

• Parallel access controlled by disk controller – computer knows nothing about it.

Page 19: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

RAID 1

• mirroring – write the identical data to multiple disks

• Requires twice as many disks as RAID 0

• If a disk fails, use the backup copy, move to a working set of mirrored space.

Page 20: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

RAID 3

• Bit-interleaved parity

• Store only enough data to recover original

• Group N blocks

• Add one bit of parity – xor of all bits.

• Lost data can be reconstructed by looking at the rest of the bits in the group.

Page 21: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

On a write

• Read all blocks of data in parity group

• Calculate new parity

• Write new block

• Write new parity

Page 22: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

RAID 4

• More efficient parity update

• On write:– Read old data– xor with new data– adjust parity– Write parity, Write new data

Page 23: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

RAID 5

• Rotate parity blocks around system

• Spread out writing (since parity always written)

Page 24: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Summary

• RAID 1 and RAID 5 most common

• 80% of server disks use RAID

• Repair:– hot swapping – replace disks with power on– Standby spares – spares included in system for

immediate reconstruction of data

Page 25: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Outline

• Introduction - 8.1

• Disk Storage and Dependability – 8.2

• Buses and other connectors – 8.4

• I/O performance measures – 8.6

Page 26: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Connecting I/O Devices

• Much slower than processor / memory

• Support lots of heterogeneous devices

Page 27: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Bus

• control lines – send / receive commands• data lines – transfer data

• processor-memory bus – fast, small bus connecting DRAM to processor

• I/O bus – slow, long bus connecting many devices to system through a controller.

Page 28: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Synchrony

• Synchronous – clock in control line, fixed protocol is relative to clock.

• Asynchronous – no clock – must coordinate through hand-shaking to determine when data is ready to send / receive.

• split transaction protocol – bus is released between data request and data response

Page 29: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

hand-shaking

• Series of steps used to coordinate bus transfers. Both parties must acknowledge they are ready before moving to next step.

• Control lines:

• ReadReq: proc/device wants to read

• DataRdy: dev/proc is ready to send data

• Ack: acknowledge ReadReq or DataRdy

Page 30: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Handshaking protocol

ReadReq

Data

Ack

DataRdy

Address Data

1

2

3

5

6

7

4: Response0: Request

Page 31: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Outline

• Introduction - 8.1

• Disk Storage and Dependability – 8.2

• Buses and other connectors – 8.4

• I/O performance measures – 8.6

Page 32: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Metric Units

• Memory: GB = 2^30

• I/O: GB = 10^9

• Be careful when reading specs

• For this class, we will pretend that all use base-2 units.

Page 33: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Measuring Performance

• Throughput more important than latency

• Large database operations (TP – Transaction Processing)

Page 34: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Example 1

• Execution time = 100 seconds

• 90 seconds CPU time, 10 sec I/O time

• CPU time improves by 50%/yr for 5 years

• I/O does not improve

• How much faster is program after 5 years?

• What percentage of new time is I/O?

Page 35: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

• New CPU time: 90 / (1.5^5) = 12 seconds

• CPU improvement: 90/12 = 7.5 speedup

• Overall improvement: 100/22 = 4.5 speedup

• Now I/O is 10/22 = 45% of total time

Page 36: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

Example 2

• System A:– .005 sec per I/O op– 4 overlapping I/O ops at a time

• System B:– .002 sec per I/O op– no overlapping I/O ops

• Which has the higher throughput?

Page 37: I/O Chapter 8. Outline Introduction - 8.1 Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6

• Throughput: 4 ops / 0.005 sec = 800 ops/sec

• Throughput: 1 op / 0.002 sec = 500 ops / sec