
ChapterChapter 12:12: Mass-StorageMass-Storage SystemsSystems ChapterChapter 12:12: Mass-StorageMass-Storage SystemsSystems ■ Overview of Mass Storage Structure ■ Disk Structure ■ Disk Attachment ■ Disk Scheduling ■ Disk Management ■ Swap-Space Management ■ RAID Structure ■ Disk Attachment ■ Stable-Storage Implementation ■ Tertiary Storage Devices ■ Operating System Issues ■ Performance Issues Operating System Concepts 12.2 Silberschatz, Galvin and Gagne ©2009 ObjectivesObjectives ■ Describe the physical structure of secondary and tertiary storage devices and the resulting effects on the uses of the devices ■ Explain the performance characteristics of mass-storage devices ■ Discuss operating-system services provided for mass storage, including RAID and HSM Operating System Concepts 12.3 Silberschatz, Galvin and Gagne ©2009 OverviewOverview ofof MassMass StorageStorage StructureStructure ■ Magnetic tape ● Was early secondary-storage medium ● Relatively permanent and holds large quantities of data ● Access time slow And random access ~1000 times slower than disk ● Mainly used for backup, storage of infrequently-used data, transfer medium between systems ● Kept in spool and wound or rewound past read-write head ● Once data under head, transfer rates comparable to disk ● 20-200GB typical storage ● Common technologies are 4mm, 8mm, 19mm, LTO-2 and SDLT ■ Today – primary mass storage structure is magnetic disks ● Tape used for backup ● Depending on capacity required, CD/DVD also sometimes used for backup Operating System Concepts 12.4 Silberschatz, Galvin and Gagne ©2009 OverviewOverview ofof MassMass StorageStorage StructureStructure (Cont.)(Cont.) ■ Magnetic disks provide bulk of secondary storage of modern computers ● Drives rotate at 60 to 200 times per second ● Transfer rate is rate at which data flow between drive and computer ● Positioning time (random-access time) is time to move disk arm to desired cylinder (seek time) and time for desired sector to rotate under the disk head (rotational latency) ● Head crash results from disk head making contact with the disk surface That’s bad ■ Disks can be removable ■ Drive attached to computer via I/O bus ● Busses vary, including EIDE, ATA, SATA, USB, Fibre Channel, SCSI ● Host controller in computer uses bus to talk to disk controller built into drive or storage array Operating System Concepts 12.5 Silberschatz, Galvin and Gagne ©2009 DiskDisk StructureStructure ■ 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. Operating System Concepts 12.6 Silberschatz, Galvin and Gagne ©2009 DiskDisk AttachmentAttachment ■ Host-attached storage accessed through I/O ports talking to I/O busses ■ SCSI itself is a type of bus, up to 16 devices on one cable, SCSI initiator requests operation and SCSI targets perform tasks ● Each target can have up to 8 logical units (disks attached to device controller ■ Fibre Channel (FC) is high-speed serial architecture ● Can be switched fabric with 24-bit address space – the basis of storage area networks (SANs) in which many hosts attach to many storage units ● Can be arbitrated loop (FC-AL) of 126 devices Operating System Concepts 12.7 Silberschatz, Galvin and Gagne ©2009 Network-AttachedNetwork-Attached StorageStorage ■ Network-attached storage (NAS) is storage made available over a network rather than over a local connection (such as a bus) ■ Although often “mounted” as a filesystem, is really a remote server ● NFS and CIFS are common protocols (with NFS’s shortcomings) ● Implemented via remote procedure calls (RPCs) between host and storage ● New iSCSI protocol uses IP network to carry the SCSI protocol Operating System Concepts 12.8 Silberschatz, Galvin and Gagne ©2009 StorageStorage AreaArea NetworkNetwork ■ “Super” version of NAS servers – SAN masks complexity – redundancy ● Large system / set of systems attached to nothing but storage (arrays) ■ Common in large storage environments (and becoming more common) Operating System Concepts 12.9 Silberschatz, Galvin and Gagne ©2009 DiskDisk SchedulingScheduling ■ Goal of OS / controller is to minimize service time (provide quickest response time) – by using hardware most efficiently ■ Time factors in reading (or writing) a disk sector are: ● Seek time is the time for the disk are to move the heads to the cylinder containing the desired sector. ● Rotational latency time is the additional time waiting for the disk to rotate the desired sector to the disk head. ● Transfer time is the time to read data and move it to the system ■ Cannot do much about transfer and latency time (HW) ■ CAN try to schedule reads/writes to minimize seek time ● Do this by minimizing seek distance ● If system / disk is reasonably busy, can have significant impact ● Scheduling can be done by system, disk, or in between Operating System Concepts 12.10 Silberschatz, Galvin and Gagne ©2009 DiskDisk SchedulingScheduling (Cont.)(Cont.) ■ Several algorithms exist to schedule the servicing of disk I/O requests. ■ We illustrate them with a request queue (0-199). 98, 183, 37, 122, 14, 124, 65, 67 Head pointer = 53 (this is where the head is currently positioned) ■ Evaluate algorithms on how well they minimize seek time, on fairness, and on complexity Operating System Concepts 12.11 Silberschatz, Galvin and Gagne ©2009 FCFSFCFS SchedulingScheduling ■ First-come-first-served scheduling – FCFS ● Serve disk read / write requests in order in which they arrive ■ Simple, fair, OK if utilization is low (i.e., disk is not very busy) ■ BUT – it often results in excessive arm movement Operating System Concepts 12.12 Silberschatz, Galvin and Gagne ©2009 FCFSFCFS Illustration shows total head movement of 640 cylinders/tracks. Operating System Concepts 12.13 Silberschatz, Galvin and Gagne ©2009 SSTFSSTF SchedulingScheduling ■ Shortest-seek-time-first scheduling ● The request chosen to be serviced next is the one closest to the current head position ● Similar in concept to SJF process scheduling ■ PROBLEM – may result in starvation ■ Can be considerable improvement over FCFS, but not optimal (because of possible starvation) ■ Illustration shows total head movement of 236 cylinders. Operating System Concepts 12.14 Silberschatz, Galvin and Gagne ©2009 SSTFSSTF (Cont.)(Cont.) Total tracks moved: 236 Operating System Concepts 12.15 Silberschatz, Galvin and Gagne ©2009 SCANSCAN ■ The disk arm starts at one end of the disk, and moves toward the other end, servicing all possible requests along the way, then moves back toward the other end of the disk, doing the same ● Note: it has to go all the way to the end of the disk (at each end) before it can turn around and start back ■ Sometimes called the elevator algorithm. ● Think of an elevator that must go to very top and very bottom floors before reversing directions ■ Can result in uneven service time, but no starvation ■ Illustration shows total head movement of 208 cylinders. Operating System Concepts 12.16 Silberschatz, Galvin and Gagne ©2009 SCANSCAN (Cont.)(Cont.) Total tracks moved: 208 Operating System Concepts 12.17 Silberschatz, Galvin and Gagne ©2009 SCANSCAN (Cont.)(Cont.) Total tracks moved: 208 NOTE – this example starts in the opposite direction from all the others, so is not a good comparison Operating System Concepts 12.18 Silberschatz, Galvin and Gagne ©2009 SCANSCAN (Cont.)(Cont.) Total tracks moved: 331 Note – this example goes in SAME DIRECTION as all the others Operating System Concepts 12.19 Silberschatz, Galvin and Gagne ©2009 C-SCANC-SCAN ■ Circular SCAN ■ The head moves from one end of the disk to the other, servicing requests as it goes. When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip. ● Only reads/writes when moving one direction ● Like SCAN, goes from first to last sector of disk, even though there may be no requests that far ■ Provides a more uniform wait time than SCAN. ■ Treats the cylinders as a circular list that wraps around from the last cylinder to the first one. Operating System Concepts 12.20 Silberschatz, Galvin and Gagne ©2009 C-SCANC-SCAN (Cont.)(Cont.) Total tracks moved: 382 NOTE: when counting tracks moved, must also count while moving from one end to other, even if doing no I/O Operating System Concepts 12.21 Silberschatz, Galvin and Gagne ©2009 LOOKLOOK SchedulingScheduling ■ Like SCAN, but arm only goes as far as the last request in each direction (i.e., does not go all the way to each end of the disk) ■ Saves arm movement (and time) ■ C-LOOK has a similar relationship to C-SCAN Operating System Concepts 12.22 Silberschatz, Galvin and Gagne ©2009 C-LOOKC-LOOK (Cont.)(Cont.) Total tracks moved: 322 Operating System Concepts 12.23 Silberschatz, Galvin and Gagne ©2009 ComparisonComparison ofof SchedulingScheduling AlgorithmsAlgorithms TOTAL TRACKS MOVED FCFS – 640 SSTF – 236 – smallest, although some requests may starve SCAN – 208 – started opposite direction from others SCAN – 331 – going same direction as all the others C-SCAN – 382 LOOK – 299 Best overall in this example C-LOOK – 322 Operating System Concepts 12.24 Silberschatz, Galvin and Gagne ©2009 SelectingSelecting
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages57 Page
-
File Size-