24
Chapter 12: Mass-Storage Systems Joe McCarthy CSS 430: Operating Systems - Mass Storage Systems 1

Chapter 12: Mass-Storage Systems

  • Upload
    olinda

  • View
    42

  • Download
    2

Embed Size (px)

DESCRIPTION

Chapter 12: Mass-Storage Systems. Joe McCarthy. Hierarchy of Memory. CSS 422. Ch 8. Variables: Speed Cost Size Volatility. Ch 12. Moving-head Disk Mechanism. R/W heads positioned just above/below each platter Contact = head crash. Disks. - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 12: Mass-Storage Systems

Chapter 12:Mass-Storage Systems

Joe McCarthy

CSS 430: Operating Systems - Mass Storage Systems 1

Page 2: Chapter 12: Mass-Storage Systems

Hierarchy of Memory

CSS 430: Operating Systems - Mass Storage Systems 2

Variables:• Speed• Cost• Size• Volatility

CSS 422

Ch 8

Ch 12

Page 3: Chapter 12: Mass-Storage Systems

Moving-head Disk Mechanism

R/W heads positionedjust above/below each platter

Contact = head crash

3CSS 430: Operating Systems - Mass Storage Systems

Page 4: Chapter 12: Mass-Storage Systems

Disks• Magnetic disks provide bulk of secondary storage of

modern computers– Drives rotate at 60 to 200 times per second– Positioning time (random-access time)

• time to move disk arm to desired cylinder (seek time) • time for desired sector to rotate under the read/write head

(rotational latency)– Transfer rate is rate at which data flow between drive and

computer• Disks can be fixed or removable• Drive connected to computer via I/O bus

– Examples: EIDE, ATA, SATA, USB, Fibre Channel, SCSI– Host controller in computer uses bus to talk to disk

controller built into drive or storage array

4CSS 430: Operating Systems - Mass Storage Systems

Page 5: Chapter 12: Mass-Storage Systems

Disk Structure• Disk drives are addressed as large 1-dimensional

arrays of logical blocks, where the logical block is the smallest unit of transfer.

• The 1-dimensional array of logical blocks is mapped into the sectors of the disk sequentially.– Sector 0 is the first sector of the first track on the

outermost cylinder.– Mapping proceeds in order through that track, then

the rest of the tracks in that cylinder, and then through the rest of the cylinders from outermost to innermost.

5CSS 430: Operating Systems - Mass Storage Systems

Page 6: Chapter 12: Mass-Storage Systems

• Host-attached storage accessed through I/O ports talking to I/O buses

Disk Attachment

6CSS 430: Operating Systems - Mass Storage Systems

Ch 13

Page 7: Chapter 12: Mass-Storage Systems

CPU vs. Disk Scheduling

• Similarities– Single shared resource [often]– High volume use

• Differences– Variability in disk “jobs” vs. CPU “jobs”

• Processes in ready queue are ready to [re]start (now)• Requests in disk queue need variable time to to start

– Knowledge of needs• Processes don’t generally know how much time needed• Disk requests generally know how much data needed

7CSS 430: Operating Systems - Mass Storage Systems

Page 8: Chapter 12: Mass-Storage Systems

Disk Scheduling• The operating system is responsible for using hardware efficiently

– For disk drives: optimizing access time and disk bandwidth

• Access time has two major components– Seek time is the time for the disk are to move the heads to the

cylinder containing the desired sector– Rotational latency is the additional time waiting for the disk to rotate

the desired sector to the disk head

• Can’t do much about the rotational latency (constant RPM)So: minimize seek time– Seek time seek distance

• Disk bandwidth = # bytes transferred / transfer time – Transfer time: time between the first request for service and the

completion of the last transfer

8CSS 430: Operating Systems - Mass Storage Systems

Page 9: Chapter 12: Mass-Storage Systems

Disk Scheduling

• Several algorithms exist to schedule the servicing of disk I/O requests

• Modeled with a request queue– Focus on seek time tracks (vs. sectors)– Assume 200 tracks (0-199)– Head starts at track 53– Request queue (track #s):

98, 183, 37, 122, 14, 124, 65, 67

9CSS 430: Operating Systems - Mass Storage Systems

Page 10: Chapter 12: Mass-Storage Systems

First Come First Served (FCFS)

Total head movement: 640 cylinders

10CSS 430: Operating Systems - Mass Storage Systems

Head movement:= |53 – 98| + |98 – 183| + |183 – 37| + |37 – 122| + |122 – 14|+ |14 – 124| + |124 – 65| + |65 – 67|

Page 11: Chapter 12: Mass-Storage Systems

Shortest Seek Time First (SSTF)

Total head movement: 236 cylinders

11CSS 430: Operating Systems - Mass Storage Systems

Similar toSJF

Risk ofstarvation

Page 12: Chapter 12: Mass-Storage Systems

SCAN

Total head movement: 236 cylinders

12CSS 430: Operating Systems - Mass Storage Systems

Like SSTFbut keepmoving insame direction,reverse whenlast track reached

Page 13: Chapter 12: Mass-Storage Systems

C-SCAN

13CSS 430: Operating Systems - Mass Storage Systems

Circular SCAN:Treats cylindersas circular bufferthat wraps around.

Yields moreuniform servicetimes

Total head movement: 382 cylinders

Page 14: Chapter 12: Mass-Storage Systems

C-LOOK

14CSS 430: Operating Systems - Mass Storage Systems

Like C-SCANbut doesn’tnecessarilygo to last trackor start atfirst track,only going as far as it needsto based on request queue

Total head movement: 322 cylinders

Page 15: Chapter 12: Mass-Storage Systems

Selecting a Disk-Scheduling Algorithm

• SSTF is common and has a natural appeal.• SCAN and C-SCAN perform better for systems that place a heavy

load on the disk.• Performance depends on the number and types of requests.• Requests for disk service can be influenced by the file-allocation

method (is the “next” block adjacent?)• The disk-scheduling algorithm should be written as a separate

module of the operating system, allowing it to be replaced with a different algorithm if necessary.

• Either SSTF or C-LOOK is a reasonable choice for the default algorithm.

15CSS 430: Operating Systems - Mass Storage Systems

Page 16: Chapter 12: Mass-Storage Systems

RAID Structure

• RAID: Redundant Arrays of Independent Disks• multiple disk drives provides reliability via

redundancy

• Increases the mean time to failure

• Frequently combined with NVRAM (write-back cache) to improve write performance

• RAID is arranged into six different levels16CSS 430: Operating Systems - Mass Storage Systems

Page 17: Chapter 12: Mass-Storage Systems

RAID Levels

17CSS 430: Operating Systems - Mass Storage Systems

Page 18: Chapter 12: Mass-Storage Systems

Tertiary Storage Devices

• Low cost is the defining characteristic of tertiary storage

• Generally, tertiary storage is built using removable media

• Examples of removable media are floppy disks, CD-ROMs, DVDs and tape

18CSS 430: Operating Systems - Mass Storage Systems

Page 19: Chapter 12: Mass-Storage Systems

Magnetic Tape

• Magnetic tape– Was early secondary-storage medium– Now: Mainly used for backup, storage of infrequently-used

data, transfer medium between systems– Relatively permanent and holds large quantities of data– ~1000 times slower than disk– Once data under head, transfer rates comparable to disk– Kept in spool and wound or rewound past read-write head– Typically 20-200GB capacity– Common technologies are 4mm, 8mm, 19mm, LTO-2 and

SDLT

19CSS 430: Operating Systems - Mass Storage Systems

Page 20: Chapter 12: Mass-Storage Systems

Tapes• Less expensive, more capacity,

but much slower than disks

• Large tape installations typically use robotic tape changers that move tapes between tape drives and storage slots in a tape library– Stacker: library that holds a few tapes– Silo: library that holds thousands of tapes

• A disk-resident file can be archived to tape for low cost storage; the computer can stage it back into disk storage for active use.

20CSS 430: Operating Systems - Mass Storage Systems

http://en.wikipedia.org/wiki/Tape_library

Page 21: Chapter 12: Mass-Storage Systems

Tape Drives• The basic operations for a tape drive differ from those of a

disk drive.• locate()positions the tape to a specific logical block, not

an entire track (corresponds to seek()).• The read position()operation returns the logical

block number where the tape head is.• The space() operation enables relative motion.• Tape drives are “append-only” devices; updating a block in

the middle of the tape also effectively erases everything beyond that block.

• An EOT mark is placed after a block that is written.

21CSS 430: Operating Systems - Mass Storage Systems

Page 22: Chapter 12: Mass-Storage Systems

Speed• Access latency – amount of time needed to locate data

– Disk: move the arm to the selected cylinder and wait for the rotational latency; typically < 35 milliseconds.

– Tape: requires winding the tape reels until the selected block reaches the tape head; tens or hundreds of seconds.

– Generally say that random access within a tape cartridge is about a thousand times slower than random access on disk.

• The low cost of tertiary storage is a result of having many cheap cartridges share a few expensive drives.

• A removable library is best devoted to the storage of infrequently used data, because the library can only satisfy a relatively small number of I/O requests per hour.

22CSS 430: Operating Systems - Mass Storage Systems

Page 23: Chapter 12: Mass-Storage Systems

Price per MB of Storage

CSS 430: Operating Systems - Mass Storage Systems 23

DRAM Hard Disk

Page 24: Chapter 12: Mass-Storage Systems

End of Chapter 11

24CSS 430: Operating Systems - Mass Storage Systems