St orage Hierarchy 10: St orage and File Syst em Regist ers Basics - - PDF document

st orage hierarchy 10 st orage and file syst em
SMART_READER_LITE
LIVE PREVIEW

St orage Hierarchy 10: St orage and File Syst em Regist ers Basics - - PDF document

St orage Hierarchy 10: St orage and File Syst em Regist ers Basics L1 Cache Fast er, Smaller, More Expensive L2 Cache Last Modif ied: DRAM 6/ 15/ 2004 12:10:04 PM Volat ile Non-Volat ile DI SK TAPE Each level act s as a cache of


slide-1
SLIDE 1

1

  • 1

10: St orage and File Syst em Basics

Last Modif ied: 6/ 15/ 2004 12:10:04 PM

  • 2

St orage Hierarchy

Regist ers DRAM DI SK L1 Cache L2 Cache TAPE Fast er, Smaller, More Expensive Each level act s as a cache of lower levels Volat ile Non-Volat ile

  • 3

Example

Mind Your Desk Shelf of books Pocket Backpack Box in st or age Fast er, Smaller?(☺) Each level act s as a cache of lower levels

  • 4

Secondary St orage

“Secondary” because unlike primary

memory does not permit direct execut ion

  • f inst ruct ions or dat a ret rieval via

load/ st ore inst ruct ions

Usually means hard disks Tends t o be larger, cheaper and slower

t han primary memory

Persist ent / Non-volat ile

Like “dur abilit y” f or t r ansact ions

  • 5

Tert iary St orage Devices

Used pr imar ily as backup and ar chival

st orage

Low cost is t he def ining charact erist ic Of t en consist s of r emovable media

Common examples of r emovable media ar e CD-

ROMs, t apes, et c. As disks get cheaper and cheaper,

duplicat ing dat a on mult iple disks becomes more and more at t ract ive as a backup st rat egy

  • 6

Typical P C

slide-2
SLIDE 2

2

  • 7

Disk Basics

Disk drives cont ain met allic plat t ers

spinning around a cent ral spindle

Read/ writ e head assembly is mount ed on an

arm t hat moves across t he surf ace of t he plat t ers

Tr ack

  • 8

Terms

Track = one r ing ar ound t he sur f ace of one

  • f t he plat t ers

Sect or = one piece of a t r ack (usually 512

byt es); More sect ors in out er t racks

Cylinder = all t racks at t he same dist ance

f rom t he cent er of t he plat t ers (I .e. all t racks readable wit hout moving t he disk arm)

  • 9

Disk Addressing

Ear ly disks wer e addr essed wit h cylinder # ,

sur f ace # and sect or #

Today disks hide inf or mat ion about t heir geomet r y

Disks export a logical array of blocks Disk it self maps f rom logical block address (LBA) t o

cylinder/ surf ace/ sect or

Allows disk t o remap bad sect ors (when f ormat t ed disk

reserves some sect ors t o use as replacement s)

Allows disk t o hide t he non- unif ormit y of t he st orage

  • Mor e dat a on out er t r acks, et c.

Disks also have int er nal caches so t hat not all

r equest s go t o t he media

On reads t ake advant age of mult iple accesses t o t he

same t rack

On writ es, say writ e is “done” when it is memory inside

t he disk

  • 10

Disk Format t ing

Low-level f or mat t ing involves dividing t he

magnet ic media int o sect or s

Each sect or act ually consist s of a header, dat a and a

t railer

Header and t railer cont ain inf ormat ion like sect or

number and error correct ing codes (ECC)

ECC is addit ional redundant bit s t hat can of t en correct

f or bit errors in t he st ored value OS also f ormat s drive

1st divides int o part it ions – each part it ion can be t reat ed

as a logically separat e drive

2cd f ile syst em f ormat t ing of part it ions (more on t hat

lat er)

  • 11

Disk I nt erf aces

I nt er f ace t o t he disk

Request specif ied wit h LBA and lengt h Request placed on bus, lat er reply placed on bus

Device dr iver hide t hese det ails

P

rovide abst ract ion of synchronous disk read OS use t he disk t o pr ovide ser vices

Virt ual memory

OS expor t s higher level abst r act ions

File syst ems

Some applicat ions use t he device dr iver int er f ace

t o build abst r act ions of t heir own (get t heir own par t it ion)

Dat abase syst ems

  • 12

RAI D

Expose an array of sect ors but

implement ed as mult iple physical disks

Arrangement and relat ionship of disks RAI D levels

slide-3
SLIDE 3

3

  • 13

Disk P erf ormance

Divide t he t ime f or an access int o st ages

Seek t ime – t ime t o move t he disk arm t o t he correct

cylinder

  • How f ast can mechanical arm move? I mproves some wit h

smaller disks but not much

Rot at ional delay – t ime wait ing f or t he correct sect or t o

rot at e under t he read/ writ e head

  • How f ast can spindle t ur n? RP

Ms go up but slowly

Transf er t ime – once head is over t he right spot how long

t o t ransf er all t he dat a

  • Larger f or larger t ransf ers
  • Rat e det ermined by RP

Ms and by densit y of t he bit s on t he disk (densit y going up ver y quickly!)

Get t ing good per f or mance f r om a dr ive (seeing

impact of a “f ast er ” dr ive” means avoiding seek and r ot at ional delay)

  • 14

Avoiding Seek and Rot at ional Delay

To t ake advant age of higher t r ansf er r at e, OS

must t r ansf er lar ger and lar ger chunks of dat a at a t ime and avoid seek and r ot at ional delay

Size and placement of virt ual memory pages? Size and placement of FS blocks?

OS t r ies t o avoid seek and r ot at ional delay by

placing t hings on disk t oget her t hat will be accessed t oget her

Can also avoid seek and r ot at ional delay by queuing

up mult iple disk r equest s and ser vicing t hem in an

  • rder t hat minimizes head movement (disk

scheduling)

Like wit h CP

U scheduling, t here are many disk scheduling algorit hms

  • 15

First Come First Serve (FCFS)

I llust rat ion shows t ot al head movement of 640 cylinders

  • 16

Short est Seek Time First (SSTJ )

Select s t he request wit h t he minimum seek

t ime f rom t he current head posit ion.

SSTF scheduling is a f or m of SJ F

scheduling; may cause st arvat ion of some request s.

  • 17

SSTF

I llust rat ion shows t ot al head movement of 236 cylinders

  • 18

SCAN

The disk arm st art s at one end of t he disk,

and moves t oward t he ot her end, servicing request s unt il it get s t o t he ot her end of t he disk, where t he head movement is reversed and servicing cont inues.

Somet imes called t he elevat or scheduling

slide-4
SLIDE 4

4

  • 19

SCAN (Cont .)

I llust rat ion shows t ot al head movement of 208 cylinders

  • 20

C-SCAN

P

rovides a more unif orm wait t ime t han SCAN (wit h scan t hose in middle wait less)

The head moves f rom one end of t he disk

t o t he ot her. servicing request s as it goes. When it reaches t he ot her end, however, it immediat ely ret urns t o t he beginning of t he disk, wit hout servicing any request s on t he ret urn t rip.

Treat s t he cylinders as a circular list t hat

wraps around f rom t he last cylinder t o t he f irst one.

  • 21

C-SCAN (Cont .)

I llust rat ion shows t ot al head movement of 382 cylinders

Misleading because seek t ime not a linear f unct ion of number of cylinder s

  • 22

C-LOOK

Version of C-SCAN Arm only goes as f ar as t he last request in

each direct ion, t hen reverses direct ion immediat ely, wit hout f irst going all t he way t o t he end of t he disk.

  • 23

C-LOOK (Cont .)

I llust rat ion shows t ot al head movement of 322 cylinders

  • 24

Select ing a Disk-Scheduling Algorit hm

SSTF is common and has a nat ur al appeal

St arvat ion not observed t o be a problem in pract ice

SCAN and C

  • SCAN perf orm bet t er f or syst ems

t hat place a heavy load on t he disk.

Per f or mance depends on t he number and t ypes of

request s.

Request s f or disk ser vice can be inf luenced by t he

f ile-allocat ion met hod.

Eit her SSTF or C

  • LOOK is a r easonable choice f or

t he def ault algorit hm.

slide-5
SLIDE 5

5

  • 25

Tracking Technology Trends

Exact comparison bet ween t echnologies

changes all t he t ime

How much slower is disk t han main memor y? Var iat ion even in disks and var ious memor y

t echnologies Tracking t hese t hings t akes a f air amount

  • f wor k
  • 26

Drive Specs (6/ 2004)

  • 27

More det ails!

  • 28

Memory Types and P rices (6/ 2004)

  • 29

Two random point s (2002)

Memor y: 128 MB, PC 133, SDRAM, $ 45

$0.35/ MB ~8 nanosecond access t ime

Disk: 20 GB, Ult r a ATA/ 100, $ 109

$0.005/ MB (1/ 2 penny per MB!!) 9.5 ms average seek (what is average? Seek t ime

increases wit h number of t racks moved but not linearly)

4.16 ms average lat ency (1/ 2 rot at ion at 7200 RPM?) 100 MB/ sec burst t ransf er (25- 41 MB/ sec sust ained

t ransf er) Disk/ Memor y Rat ios

P

rice: 1/ 70

Size: 160/ 1 Speed (Access t ime): 13 ms/ 8ns = 1625000/ 1 Speed (Transf er rat e): 40 MB/ s / 1.1 GB/ s = 1/ 30

  • 30

Pr ice per Megabyt e of DRAM,

From 1981 t o 2000

slide-6
SLIDE 6

6

  • 31

Price per Megabyt e of Magnet ic Hard Disk, From 1981 t o 2000

  • 32

OS adapt s t o perf ormance t rends?

For t he OS t o make t he r ight choices if needs t o

be awar e of t he t r ade-of f s

I s t he speed comparison bet ween regist ers, DRAM and

disk like t he dif f erence bet ween your mind, your pocket and your book shelf *OR* is more like t he dif f erence bet ween your pocket , t he bookst ore and P lut o?

How much comput at ion/ met a-dat a st orage is reasonable

t o do t o avoid a disk access?

Should we use DRAM as a f ile cache or t o st ore more

memory page f or processes? “Right ” answer changes wit h new gener at ions of

t echnology and OS sour ce lives much longer t han t hat ?

Can OS measur e per f or mance and be coded t o

react t o measurement s?

  • 33

File Syst ems

Today t alked a bit about disk int ernals Despit e complex int ernals, disks export a

simple array of sect ors

Next , how do we go f rom t hat t o a f ile

syst em?

What do we exact ly do we expect f rom a

f ile syst em?

  • 34

Out t akes

  • 35

Drive int erf aces

SCSI

Fast , wide,…

. Ult raATA

ATA, I DE

SerialATA

  • 36

Next t ime

Consider ot her t er t iar y st or age device opt ions

inst ead of st ar t on f ile syst ems

Floppy dr ives

Thin f lexible disk coat ed wit h magnet ic mat erial enclosed

in a prot ect ive plast ic case CDROMS

Spiral t owards cent er not concent ric circles like hard

drives C

D-Rs and CD-RW s

WORM Disks Magnet o-Opt ical disks Tapes I nt r oduce r eliabilit y aspect of dif f er ent media

slide-7
SLIDE 7

7

  • 37

RAI D

  • 38

Fall 2002: Current Drive Specs

  • 39

Fall 2002: More det ails!

  • 40

Fall 2002: Memory Types and P rices

  • 41

Fall 2002: Two random point s

Memory: 128 MB, PC 133, SDRAM, $45

$ 0.35/ MB ~8 nanosecond access t ime

Disk: 20 GB, Ult ra ATA/ 100, $109

$ 0.005/ MB (1/ 2 penny per MB!!) 9.5 ms aver age seek (what is aver age? Seek

t ime incr eases wit h number of t r acks moved but not linear ly)

4.16 ms aver age lat ency (1/ 2 r ot at ion at 7200

RPM?)

  • 42

100 MB/ sec burst t ransf er (25-41 MB/ sec sust ained t ransf er)

Disk/ Memor y Rat ios

Pr ice: 1/ 70 Size: 160/ 1 Speed (Access t ime): 13 ms/ 8ns = 1625000/ 1 Speed (Tr ansf er r at e): 40 MB/ s / 1.1 GB/ s =

1/ 30

slide-8
SLIDE 8

8

  • 43

Disk Scheduling

FCFS

Service request s in order t hey arrive No possibilit y of dat a inconsist ency

SSTF (Shor t est seek t ime f ir st )

Do closest request f irst Unf airly f avors middle t racks

SCAN (elevat or scheduling)

Service request s in one direct ion unt il done, t hen reverse

C

  • SCAN

Like SCAN, but when done do not reverse, ret urn t o t he

beginning

  • 44

Cost

Main memor y is much mor e expensive t han disk

st orage

The cost per megabyt e of har d disk st or age is

compet it ive wit h magnet ic t ape if only one t ape is used per drive.

The cheapest t ape dr ives and t he cheapest disk

dr ives have had about t he same st or age capacit y

  • ver t he years.

Ter t iar y st or age gives a cost savings only when

t he number of car t r idges is consider ably lar ger t han t he number of drives.

  • 45

P rice per Megabyt e of a Tape Drive, From 1984-2000