Chapter 10 Mass-Storage Structure

Slides:



Advertisements
Similar presentations
I/O Management and Disk Scheduling
Advertisements

Overview of Mass Storage Structure
I/O Management and Disk Scheduling Chapter 11. I/O Driver OS module which controls an I/O device hides the device specifics from the above layers in the.
I/O Management and Disk Scheduling
RAID Redundant Array of Independent Disks
Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
RAID and Other Disk Details
Other Disk Details. 2 Disk Formatting After manufacturing disk has no information –Is stack of platters coated with magnetizable metal oxide Before use,
Device Management.
Disks CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Mass-Storage Systems Revised Tao Yang.
I/O Systems and Storage Systems May 22, 2000 Instructor: Gary Kimura.
CSE 451: Operating Systems Winter 2010 Module 13 Redundant Arrays of Inexpensive Disks (RAID) and OS structure Mark Zbikowski Gary Kimura.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
12.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 12: Mass-Storage Systems.
Chapter 6 RAID. Chapter 6 — Storage and Other I/O Topics — 2 RAID Redundant Array of Inexpensive (Independent) Disks Use multiple smaller disks (c.f.
CS 346 – Chapter 10 Mass storage –Advantages? –Disk features –Disk scheduling –Disk formatting –Managing swap space –RAID.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
Redundant Array of Inexpensive Disks aka Redundant Array of Independent Disks (RAID) Modified from CCT slides.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable Used to communicate with the user Printers Video display terminals.
Chapter 12: Mass-Storage Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 12: Mass-Storage.
Chapter 12 – Mass Storage Structures (Pgs )
I/O Management and Disk Scheduling Chapter 11. Disk Performance Parameters To read or write, the disk head must be positioned at the desired track and.
RAID Disk Arrays Hank Levy. 212/5/2015 Basic Problems Disks are improving, but much less fast than CPUs We can use multiple disks for improving performance.
I/O Scheduling Computer Organization II 1 Disk Scheduling Carrying out disk accesses in the order they are received will not always produce optimal performance.
Part IV I/O System Chapter 12: Mass Storage Structure.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
I/O Errors 1 Computer Organization II © McQuain RAID Redundant Array of Inexpensive (Independent) Disks – Use multiple smaller disks (c.f.
Magnetic Disks Have cylinders, sectors platters, tracks, heads virtual and real disk blocks (x cylinders, y heads, z sectors per track) Relatively slow,
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems DISK I/0.
Chapter 10: Mass-Storage Systems
Operating System (013022) Dr. H. Iwidat
Multiple Platters.
Disks and RAID.
I/O System Chapter 5 Designed by .VAS.
Chapter 12: Mass-Storage Structure
Disk Scheduling Algorithms
Mass-Storage Structure
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
Chapter 10: Mass-Storage Systems
Chapter 14 Based on the slides supporting the text
RAID Disk Arrays Hank Levy 1.
RAID RAID Mukesh N Tekwani
Chapter 12: Mass-Storage Systems
Sanuja Dabade & Eilbroun Benjamin CS 257 – Dr. TY Lin
Chapter 37 Hard Disk Drives
RAID Disk Arrays Hank Levy 1.
CSE 451: Operating Systems Spring 2005 Module 17 Redundant Arrays of Inexpensive Disks (RAID) Ed Lazowska Allen Center 570.
CSE 451: Operating Systems Autumn 2010 Module 19 Redundant Arrays of Inexpensive Disks (RAID) Ed Lazowska Allen Center 570.
CSE 451: Operating Systems Winter 2009 Module 13 Redundant Arrays of Inexpensive Disks (RAID) and OS structure Mark Zbikowski Gary Kimura 1.
RAID Redundant Array of Inexpensive (Independent) Disks
Mark Zbikowski and Gary Kimura
Disks and scheduling algorithms
CSE 451: Operating Systems Autumn 2004 Redundant Arrays of Inexpensive Disks (RAID) Hank Levy 1.
Mass-Storage Systems.
CSE 451: Operating Systems Winter 2012 Redundant Arrays of Inexpensive Disks (RAID) and OS structure Mark Zbikowski Gary Kimura 1.
Chapter 11 I/O Management and Disk Scheduling
Disk Scheduling Carrying out disk accesses in the order they are received will not always produce optimal performance. Seek time is the reason for differences.
CSE 451: Operating Systems Autumn 2009 Module 19 Redundant Arrays of Inexpensive Disks (RAID) Ed Lazowska Allen Center 570.
RAID Disk Arrays Hank Levy 1.
RAID RAID Mukesh N Tekwani April 23, 2019
CSE 451: Operating Systems Winter 2004 Module 17 Redundant Arrays of Inexpensive Disks (RAID) Ed Lazowska Allen Center 570.
Chapter 11: Mass-Storage Systems
ITEC 202 Operating Systems
Lecture 10: Magnetic Disks
CSE 451: Operating Systems Winter 2006 Module 18 Redundant Arrays of Inexpensive Disks (RAID) Ed Lazowska Allen Center 570.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

Chapter 10 Mass-Storage Structure

Storage Hierarchy

Hard Disk Drive Magnetic disks provide bulk of secondary storage of modern computers Disks can be removable Drive attached to computer via I/O bus Busses vary, including EIDE, ATA, SATA, USB, Fibre Channel, SCSI, SAS, Firewire Host controller in computer uses bus to talk to disk controller built into drive or storage array

Moving-head Disk Mechanism

Physical disk organization When the disk drive is operating, the disk is rotating at constant speed To read or write, the disk head must be positioned on the desired track and at the beginning of the desired sector Once the head is in position, the read or write operation is then performed as the sector moves under the head Seek time is the time it takes to position the head on the desired track Rotational delay or rotational latency is the additional time it takes for the beginning of the sector to reach the head once the head is in position Transfer time is the time for the sector to pass under the head Timing of a disk I/O transfer

Physical disk organization Access time = seek time + rotational latency + transfer time Efficiency of a sequence of disk accesses strongly depends on the order of the requests Adjacent requests on the same track avoid additional seek and rotational latency times Loading a file as a unit is efficient when the file has been stored on consecutive sectors on the same track/cylinder of the disk

Transfer Time Depend on the rotation speed of the disk: T = b/(rN) Where T: transfer time b: number of bytes to be transferred N: number of bytes on a track/cylinder r: rotation speed, in revolutions per second Thus, the total average access time is Ts + 0.5/r + b/(rN), where Ts is the average seek time.

A Time Comparison Consider a disk with an advertised average seek time of 4ms, rotation speed of 7500 rpm, and 512-byte sectors with 500 sectors per track. Suppose that we wish to read a file consisting of 2500 sectors for a total of 1.28 Mbytes. We would like to estimate the total time for the transfer. 1) Sequential organization: the file is stored on 5 adjacent tracks (5 tracks * 500 sectors/track = 2500 sectors). 2) The sectors are distributed randomly over the disk.

Disk Scheduling Policies Seek time is the major reason for differences in performance For a single disk there will be a number of I/O requests If requests are selected randomly, get poor performance Example: 55, 58, 39, 18, 90, 160, 150, 38, 184

Disk Scheduling Policies First-in, first-out (FIFO) Process request sequentially Fair to all processes Example: 55, 58, 39, 18, 90, 160, 150, 38, 184 Approaches random scheduling in performance if there are many processes

Disk Scheduling Policies Shortest Service/Seek Time First Select the disk I/O request that requires the least movement of the disk arm from its current position Always choose the minimum seek time Example: 55, 58, 39, 18, 90, 160, 150, 38, 184 Requests for tracks far away from the current position may never be served, if requests for closer tracks are issued continuously

Disk Scheduling Policies LOOK (SCAN) Arm moves in one direction only, satisfying all outstanding requests until it reaches the last request in that direction Direction is reversed Example: 55, 58, 39, 18, 90, 160, 150, 38, 184

Disk Scheduling Policies C-LOOK (C-SCAN) Restricts scanning to one direction only When the last request has been visited in one direction, the arm is returned to the opposite end of the disk and the scan begins again In case of repetitive requests to one track, we will see “arm stickiness” in SSTF, LOOK, C-LOOK

Disk Scheduling Policies N-step-SCAN Segment the disk request queue into subqueues of length N Subqueues are processed one at a time, using LOOK/SCAN New requests added to other queue when a queue is processed

Disk Scheduling Policies FSCAN Two subqueues One queue is empty for new requests

Disk Scheduling Algorithms

RAID Motivation Disks are improving, but not as fast as CPUs 1970s seek time: 50-100 ms. 2000s seek time: <5 ms. Factor of 20 improvement in 3 decades We can use multiple disks for improving performance By striping files across multiple disks (placing parts of each file on a different disk), parallel I/O can improve access time Striping reduces reliability What’s the mean time between failures of 100 disks, assuming T as the mean time between failures of one disk? The mean time between failures of 100 disks = 1/100 times of the mean time between failures of one disk So, we need striping for performance, but we need something to help with reliability To improve reliability, we can add redundant data to the disks, in addition to striping

RAID A RAID is a Redundant Array of Inexpensive Disks “I” is also for “Independent” The alternative is SLED, single large expensive disk Disks are small and cheap, so it’s easy to put lots of disks (10s to 100s) in one box for increased storage, performance, and availability The RAID box with a RAID controller looks just like a SLED to the computer Data plus some redundant information is striped across the disks in some way How that striping is done is key to performance and reliability.

Raid Level 0 Level 0 is nonredundant disk array Files are striped across disks, no redundant info High read throughput Best write throughput (no redundant info to write) Any disk failure results in data loss Reliability worse than SLED Stripe 0 Stripe 1 Stripe 2 Stripe 3 Stripe 7 Stripe 4 Stripe 5 Stripe 6 Stripe 8 Stripe 11 Stripe 9 Stripe 10 data disks

Raid Level 1 Mirrored Disks Data is written to two places On failure, just use surviving disk On read, choose fastest to read Write performance is same as RAID 0, read performance is 2x better Replication redundancy is expensive Stripe 0 Stripe 1 Stripe 2 Stripe 3 Stripe 0 Stripe 1 Stripe 2 Stripe 3 Stripe 7 Stripe 7 Stripe 4 Stripe 5 Stripe 6 Stripe 4 Stripe 5 Stripe 6 Stripe 8 Stripe 11 Stripe 8 Stripe 11 Stripe 9 Stripe 10 Stripe 9 Stripe 10 data disks mirror copies

Parity and Hamming Codes What do you need to do in order to detect and correct a one-bit error? Suppose you have a binary number, represented as a collection of bits: <b3, b2, b1, b0>, e.g. 0110 Detection is easy Parity: Count the number of bits that are on, see if it’s odd or even Parity is 0 if the number of 1 bits is even Parity(<b3, b2, b1, b0 >) = P0 = b0  b1  b2  b3 Parity(<b3, b2, b1, b0, p0>) = ? Parity(<b3, b2, b1, b0, p0>) = 0 if all bits are intact Parity(0110) = 0, Parity(01100) = 0 Parity(11100) = 1 => ERROR! Parity can detect a single error, but can’t tell you which of the bits got flipped

Hamming Code History In the late 1940’s Richard Hamming recognized that the further evolution of computers required greater reliability, in particular the ability to not only detect errors, but correct them. His search for error-correcting codes led to the Hamming Codes, perfect 1-error correcting codes, and the extended Hamming Codes, 1-error correcting and 2-error detecting codes.

Parity and Hamming Codes Detection and correction require more work Hamming codes can detect & correct single bit errors [7,4] binary Hamming Code h0 = b0  b1  b3 h1 = b0  b2  b3 h2 = b1  b2  b3 H0(<1101>) = 0 H1(<1101>) = 1 H2(<1101>) = 0 Hamming(<1101>) = <b3, b2, b1, h2, b0, h1, h0> = <1100110> If a bit is flipped, e.g. <1110110> a = h0  b0  b1  b3 = 1 b = h1  b0  b2  b3 = 0 c = h2  b1  b2  b3 = 1 abc = <101>, the 5th bit is in error and switch it

Extended [8,4] binary Hamm. Code As with the [7,4] binary Hamming Code: h0 = b0  b1  b3 h1 = b0  b2  b3 h2 = b1  b2  b3 Add a new bit p such that p = b0  b1  b2  b3  h0  h1  h2 . i.e., the new bit makes the XOR of all 8 bits zero. p is called a parity check bit. Assume at most 2 errors: If parity check passes and abc = 000, the system is correct; If parity check passes and abc ≠ 000, the system has two errors; If parity check fails, there is one error and abc indicates which bit is in error.

Raid Level 2 Bit-level striping with Hamming (ECC) codes for error correction All 7 disk arms are synchronized and move in unison Complicated controller Single access at a time Tolerates only one error Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 ECC: error correcting codes data disks ECC disks

Raid Level 3 Use a parity disk A read accesses all the data disks Each bit on the parity disk is a parity function of the corresponding bits on all the other disks A read accesses all the data disks A write accesses all data disks plus the parity disk On a disk failure, read remaining disks plus parity disk to compute the missing data In RAID 3 (byte-level striping with dedicated parity), all disk spindle rotation is synchronized, and data is striped so each sequentiabyte is on a different drive. Parity is calculated across corresponding bytes and stored on a dedicated parity drive. Bit 0 Bit 1 Bit 2 Bit 3 Parity Parity disk data disks

RAID 3 X4(i) = X3(i)  X2(i)  X1(i)  X0(i) If drive X1 has failed. How to recover it?

Raid Level 4 Combines Level 0 and 3 – block-level parity with Stripes A read accesses all the data disks A write accesses all data disks plus the parity disk Stripe 0 Stripe 1 Stripe 2 Stripe 3 P0-3 Stripe 7 Stripe 4 Stripe 5 Stripe 6 P4-7 Stripe 8 Stripe 11 P8-11 Stripe 9 Stripe 10 Parity disk data disks

RAID 4 (block-level parity) X4(i) = X3(i)  X2(i)  X1(i)  X0(i) How to execute a write operation, for instance on drive X1? Heavy load on the parity disk

RAID 5 (block-level distributed parity)

RAID 6 (dual redundancy) P & Q are two different data check algorithms. Level 5 with an extra parity bit, which is generated with a different and independent data check algorithm* Can tolerate two failures * http://www.emc.com/collateral/hardware/white-papers/h2891-clariion-raid-6.pdf

References Referred to lecture notes by Dr. Mark Temte at Indiana University – Purdue University Fort Wayne and by Dr. Einar Vollset at Cornell University I have modified them and added new slides