ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections...

33
ENGS 116 Lecture 17 1 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 – 7.4 Reading for Monday: Sections 7.5 – 7.9, 7.14 Homework for Monday: 5.4, 5.17, 5.18, 6.4, 6.10, 6.14

Transcript of ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections...

Page 1: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 1

Introduction to I/O

Vincent Berk

November 16, 2007

Reading for today: Sections 6.8 – 6.10, 6.14

Reading for Monday: Sections 7.1 – 7.4

Reading for Monday: Sections 7.5 – 7.9, 7.14

Homework for Monday: 5.4, 5.17, 5.18, 6.4, 6.10, 6.14

Page 2: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 2

The Big Picture: Where are we now?

Control

Datapath

Memory

Input

Output

Processor

Page 3: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 3

I/O Systems

Page 4: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 4

Storage System Issues

• Historical Context of Storage I/O

• Secondary and Tertiary Storage Devices

• Storage I/O Performance Measures

• A Little Queueing Theory

• Processor Interface Issues

• I/O Buses

• Redundant Arrays of Inexpensive Disks (RAID)

• I/O Benchmarks

Page 5: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 55ENGS 116 Lecture 17

Motivation: Who Cares About I/O?

• CPU Performance: 50% to 100% per year

• I/O system performance limited by mechanical delays

< 5% per year (IO per sec or MB per sec)

• Amdahl's Law: system speed-up limited by the slowest part!

10% IO & 10x CPU => 5x Performance (lose 50%)

10% IO & 100x CPU => 10x Performance (lose 90%)

• I/O bottleneck:

Diminishing fraction of time in CPU

Diminishing value of faster CPUs

Page 6: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 66ENGS 116 Lecture 17

• Today: Processing power doubles every 18 months

•  Today: Memory size doubles every 18 months (4X/3 yrs)

•  Today: Disk capacity doubles every 18 months

•  Disk positioning rate (seek + rotate) doubles every ten years!

Technology Trends

The I/OGAP

Page 7: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 7

Storage Technology Drivers

• Driven by the prevailing computing paradigm

– 1950s: migration from batch to on-line processing

– 1990s: migration to ubiquitous computing

• computers in phones, books, cars, video cameras, …

• nationwide fiber optical network with wireless tails

• Effects on storage industry:

– Embedded storage

• smaller, cheaper, more reliable, lower power

• Interesting twist: Apple I-pod

– Data utilities

• high capacity, hierarchically managed storage

Page 8: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 8

Historical Perspective

• 1956 IBM Ramac — early 1970s Winchester– Developed for mainframe computers, proprietary interfaces

– Steady shrink in form factor: 27 in. to 14 in.

• 1970s developments– 5.25-inch floppy disk form factor

– early emergence of industry standard disk interfaces• ST506, SASI, SMD, ESDI

• Early 1980s– PCs and first generation workstations

• Mid 1980s– Client/server computing

– Centralized storage on file server

• accelerates disk downsizing: 8 inch to 5.25 inch

– Mass market disk drives become a reality

• industry standards: SCSI, IDE, SATA

• 5.25-inch drives for standalone PCs, end of proprietary interfaces

Page 9: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 9

Disk History

Data densityMbit/sq. in.

Capacity ofUnit ShownMegabytes

1973:1. 7 Mbit/sq. in140 MBytes

1979:7. 7 Mbit/sq. in2,300 MBytes

Source: New York Times, 2/23/98, page C3, “Makers of disk drives crowd even more data into even smaller spaces”

Page 10: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 10

Historical Perspective

• Late 1980s/Early 1990s:

– Laptops, notebooks, (palmtops)

– 3.5 inch, 2.5 inch, 1.8 inch formfactors

– Formfactor plus capacity drives market, not so much performance

• Recently Bandwidth improving at 40%/ year

– Challenged by DRAM, flash RAM in PCMCIA cards

• still expensive, Intel promises but doesn’t deliver

• unattractive MBytes per cubic inch

– Optical disk fails on performance (e.g., NEXT) but finds niche (CD ROM)

Page 11: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 11

Disk History

1989:63 Mbit/sq. in60,000 MBytes

1997:1450 Mbit/sq. in2300 MBytes

Source: New York Times, 2/23/98, page C3, “Makers of disk drives crowd even more data into even smaller spaces”

1997:3090 Mbit/sq. in8100 MBytes

Page 12: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 1212ENGS 116 Lecture 17

Alternative Data Storage Technologies: Early 1990s

DataCap BPI TPI BPI*TPI Transfer Access

Technology (MB) (Million) (KByte/s) Time

Conventional Tape:Cartridge (.25") 150 12000 104 1.2 92 minutesIBM 3490 (.5") 800 22860 38 0.9 3000 seconds

Helical Scan Tape:

Video (8mm)4600 43200 1638 71 492 45 secsDAT (4mm) 1300 61000 1870 114 183 20 secsD-3 (1/2") 20,000 15 secs?

Magnetic & Optical Disk:Hard Disk (5.25") 1200 33528 1880 63 3000 18 msIBM 3390 (10.5") 3800 27940 2235 62 4250 20 ms

Sony MO (5.25") 640 24130 18796 454 88 100 ms

Page 13: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 1313ENGS 116 Lecture 17

Devices: Magnetic Disks

• Purpose:

– Long-term, nonvolatile storage

– Large, inexpensive, slow level in the storage hierarchy

• Characteristics:

– Seek Time (~ 8 ms avg)

• positional latency

• rotational latency

• Transfer rate

– About a sector per ms (10-40 MB/s)

– Blocks

• Capacity

– Gigabytes

– Quadruples every 3 years

7200 RPM = 120 RPS 8 ms per rev avg. rot. latency = 4 ms128 sectors per track 0.0625 ms per sector1 KB per sector 16 MB / s

Response time = Queue + Controller + Seek + Rot + Transfer

Service time

SectorTrack

Cylinder

HeadPlatter

Page 14: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 1414ENGS 116 Lecture 17

Disk Device Terminology

Disk Latency = Queueing Time + Controller Time + Seek Time + Rotation Time + Transfer Time

Order-of-magnitude times for 4K byte transfers:

Seek: 8 ms or lessRotate: 4.2 ms @ 7200 rpm Transfer: 1 ms @ 7200 rpm

Platter

Outer TrackInner Track

SectorHead

ArmActuator

Page 15: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 1515ENGS 116 Lecture 17

Disk Device Terminology

Page 16: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 16

Tape vs. Disk

• Longitudinal tape uses same technology as hard disk; tracks its density improvements

• Disk head flies above surface, tape head lies on surface• Inherent cost-performance based on geometries:

fixed rotating platters with gaps(random access, limited area, 1 media / reader)

vs.removable long strips wound on spool

(sequential access, "unlimited" length, multiple / reader)• Modern technology:

Helical Scan (VCR, Camcorder, DAT) Spins head at angle to tape to improve density

Page 17: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 17

R-DAT Technology

90° Wrap AngleDrum Direction

ofTape

Track

Rotary Drum

Four Head Recording

Tracks Recorded ± 20° w/o guard band

Read After Write Verify

Helical Recording Scheme

2000 RPMR

R

WW

Page 18: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 18

Example: R-DAT Technology

• Rotating (vs. Stationary) head (Digital Audio Tape)

• Highest areal recording density commercially available

• High density due to:– high coercivity metal tape– helical scan recording method– narrow, gapless (overlapping) recording tracks

• 10X improvement capacity & transfer rate by 1999– faster tape and drum speeds– greater track overlap

• No significant changes since late 90s

Page 19: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 19

R-DAT Technology

BlockTrack (2900 Data Bytes)Frame (2 Tracks)Group (22 Frames + Optional Group ECC, 128 K bytes)

65% of Track is Data Area 70% Data Bytes 30% Bytes Parity Plus Reed-Solomon Codes Track Finding Area (Servo)Subcode Area (Index)Margin Area

Theoretical Bit Error Rates: • w/o group ECC: one in 1026

• w/ group ECC: one in 1033

Tape

Track

Frame

DDS ANSI Standard (HP, SONY)

Page 20: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 2020ENGS 116 Lecture 17

Current Drawbacks to Tape

• Tape wears out:

– Helical 100s of passes to 1000s for longitudinal

• Head wears out:

– 2000 hours for helical

• Both must be accounted for in economic/reliability model

• Long rewind, eject, load, spin-up times;

not inherent, just no need in marketplace (so far)

• Designed for archival storage

• Capacities: 700 GB per tape, but used in big libraries (150 PB)

Page 21: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 21

Modern Day Tape specs.

• Sun StorageTek SL 8500 tape library– Up to 150,000 TB of

archival storage– With 2,048 drives:

884.7 TB/hr– 60 minutes to read

entire library– 11 seconds to find

and load any type in library

Page 22: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 22

Optical Disks: CD-ROM vs. DVD

• Both 12 cm in diameter (most-common size for CD-ROM)

• CD-ROM

– Maximum 80 minutes of music

– 700 MB of information

• DVD (Digital Versatile/Video Disk)

– 4.7 GB of information on one of its two sides — enough for 133-minute movie

– With 2 layers on each of its two sides, will hold up to 17 gigabytes

– Uses MPEG-2 file compression standard

• Blue Ray DVD (higher density)– Up to 200 GB of capacity per disc

Page 23: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 23

Disk I/OPerformance

Response time = Queue + Device Service time

Proc

Queue

IOC Device

Metrics: Response Time Throughput

Page 24: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 24

Response Time vs. Productivity

• Interactive environments: Each interaction or transaction has 3 parts:

– Entry Time: time for user to enter command

– System Response Time: time between user entry & system replies

– Think Time: Time from response until user begins next command1st transaction

2nd transaction

• What happens to transaction time as system response time shrinks from 1.0 sec to 0.3 sec?

– With keyboard: 4.0 sec entry, 9.4 sec think time

– With graphics: 0.25 sec entry, 1.6 sec think time

Page 25: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 25

Time

0.00 5.00 10.00 15.00

graphics1.0s

graphics0.3s

conventional1.0s

conventional0.3s

entry resp think

Response Time & Productivity

• 0.7 sec off response saves 4.9 sec (34%) and 2.0 sec (70%) total time per transaction => greater productivity

• Another study: everyone gets more done with faster response, but novice with fast response = expert with slow

Page 26: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 26

Response Time & Productivity

Page 27: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 27

Disk Time Example

• Disk parameters:– Transfer size is 8K bytes

– Advertised average seek is 12 ms

– Disk spins at 7200 RPM

– Transfer rate is 4 MB/sec

• Controller overhead is 2 ms

• Assume that disk is idle so no queueing delay

• What is average disk access time for a sector?– Avg seek + avg rotational delay + transfer time + controller overhead

– 12 ms + 0.5/(7200 RPM/60) + 8 KB/4 MB/s + 2 ms

– 12 + 4.15 + 2 + 2 = 20 ms

• Advertised seek time assumes no locality: typically 1/4 to 1/3 advertised seek time: 20 ms => 12 ms

Page 28: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 28

The following simplified diagram shows two potential ways of numbering the sectors of data on a disk (only two tracks are shown and each track has eight sectors). Assuming that typical reads are contiguous (e.g., all 16 sectors are read in order), which way of numbering the sectors will be likely to result in higher performance? Why?

13

0

2

1

3

4

5

6

7

89

10

11

12

14

15

11

0

2

1

3

4

5

6

7

1415

8

9

10

12

13

Page 29: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 29

Processor Interface Issues

• Interconnections

– Busses

• Processor Interface

– Interrupts

– Memory mapped I/O

• I/O Control Structures

– Polling

– Interrupts

– DMA

– I/O controllers

– I/O processors

• Capacity, Access Time, Bandwidth

Page 30: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 30

Busses

• Bus: a shared communication link between subsystems

• Disadvantage: a communication bottleneck, possibly limiting the maximum I/O throughput

• Bus speed is limited by physical factors

• Two generic types of busses

– I/O

– CPU-memory

• Bus transaction: sending address & receiving or sending data

Page 31: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 31

Bus Options

Option High performance Low cost

Bus width Separate address Multiplex address& data lines & data lines

Data width Wider is faster Narrower is cheaper (e.g., 32 bits) (e.g., 8 bits)

Transfer size Multiple words has Single-word transferless bus overhead is simpler

Bus masters Multiple Single master(requires arbitration) (no arbitration)

Split Yes — separate No — continuous transaction? Request and Reply connection is cheaper

packets for higher and has lower latencybandwidth(needs multiple masters)

Clocking Synchronous Asynchronous

Page 32: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 32

Interface Interface

PeripheralPeripheral

Memory

I/O Interface

CPU

Separate I/O instructions (in, out)

40 Mbytes/sec optimistically

10 MIP processor completely saturates the bus!

VME bus Multibus-II

Nubus

Common memory & I/O bus

CPU Memory

Interface Interface

PeripheralPeripheral

Independent I/O busMemory

bus

Page 33: ENGS 116 Lecture 171 Introduction to I/O Vincent Berk November 16, 2007 Reading for today: Sections 6.8 – 6.10, 6.14 Reading for Monday: Sections 7.1 –

ENGS 116 Lecture 17 33

I/O devices

Backplane bus MemoryProcessor

a.

c.

b.

MemoryProcessorProcessor-memory bus

Bus adapter

I/O bus

Bus adapter

I/O bus

Bus adapter

I/O bus

MemoryProcessor

Bus adapter

Bus adapter

Bus adapter

Processor-memory bus

I/O bus

I/O bus

Backplane bus