Lecture 10: Magnetic Disks

Slides:



Advertisements
Similar presentations
Disk Storage SystemsCSCE430/830 Disk Storage Systems CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu (U. Maine) Fall,
Advertisements

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.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
Day 30 I/O Management and Disk Scheduling. I/O devices Vary in many ways Vary in many ways –Data rate –Application –Complexity of control –Unit of transfer.
Input/Output Management and Disk Scheduling
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
Disks.
Device Management.
Secondary Storage CSCI 444/544 Operating Systems Fall 2008.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
Storage Systems. Main Points File systems – Useful abstractions on top of physical devices Storage hardware characteristics – Disks and flash memory File.
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
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.
Disk and I/O Management
CS4432: Database Systems II Data Storage (Better Block Organization) 1.
CENG334 Introduction to Operating Systems Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
Physical Storage and File Organization COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
IT 344: Operating Systems Winter 2010 Module 13 Secondary Storage Chia-Chi Teng CTB 265.
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.
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.
Disk Basics CS Introduction to Operating Systems.
Device Management Mark Stanovich Operating Systems COP 4610.
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
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.
Device Management Andy Wang Operating Systems COP 4610 / CGS 5765.
Lecture 17 Raid. Device Protocol Variants Status checks: polling vs. interrupts Data: PIO vs. DMA Control: special instructions vs. memory-mapped I/O.
CSE 451: Operating Systems Spring 2010 Module 12.5 Secondary Storage John Zahorjan Allen Center 534.
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
Sarah Diesburg Operating Systems CS 3430
Disks and RAID.
Introduction to Operating Systems
Secondary Storage Secondary storage typically: Characteristics:
Disk Scheduling Algorithms
Mass-Storage Structure
IT 344: Operating Systems Winter 2008 Module 13 Secondary Storage
Chapter 10 Mass-Storage Structure
Introduction to Operating Systems
Operating Systems (CS 340 D)
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
CSE 451: Operating Systems Winter 2006 Module 13 Secondary Storage
EECE.4810/EECE.5730 Operating Systems
CSE 451: Operating Systems Autumn 2003 Lecture 12 Secondary Storage
CSE 451: Operating Systems Winter 2007 Module 13 Secondary Storage
CSE 451: Operating Systems Spring 2006 Module 13 Secondary Storage
Disks and scheduling algorithms
Secondary Storage Management Brian Bershad
Persistence: hard disk drive
CSE 451: Operating Systems Secondary Storage
Chapter 11 I/O Management and Disk Scheduling
CSE 451: Operating Systems Winter 2003 Lecture 12 Secondary Storage
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 Winter 2009 Module 12 Secondary Storage
Chapter 12: Mass-Storage Structure
CSE 451: Operating Systems Spring 2005 Module 13 Secondary Storage
Secondary Storage Management Hank Levy
CSE451 File System Introduction and Disk Drivers Autumn 2002
CSE 451: Operating Systems Autumn 2004 Secondary Storage
CSE 451: Operating Systems Winter 2004 Module 13 Secondary Storage
ITEC 202 Operating Systems
CSE 451: Operating Systems Spring 2007 Module 11 Secondary Storage
Andy Wang Operating Systems COP 4610 / CGS 5765
Introduction to Operating Systems
Presentation transcript:

Lecture 10: Magnetic Disks SE350: Operating Systems Lecture 10: Magnetic Disks

Storage Devices Storage that (usually) survives across machine crashes Block level (random) access Large capacity at low cost Relatively slow performance Magnetic disk read takes 10-20M processor instructions

Disk Storage Devices Magnetic disks Storage that rarely becomes corrupted Large capacity at low cost Block level random access Slow performance for random access Better performance for streaming access

Magnetic Disk Disk and flash device has a CPU in it – it needs it for the complex reasoning it needs to make; e.g., disk head scheduling is now done by the disk device itself, as is remapping. Disks in very olden times very smart – because the CPU was insanely expensive. When CPU’s were moderately expensive, then I/O devices became dumb – so that you could build a cheaper overall system, the file system had to do more work. Now, the CPU is very cheap, so can include more intelligence on the device. www.lorextechnology.com

Disk Tracks About 1 micron wide Separated by unused guard regions Wavelength of light is ~ 0.5 micron Resolution of human eye: 50 microns 100K tracks on a typical 2.5” disk Separated by unused guard regions Reduces likelihood neighboring tracks are corrupted during writes (still a small non-zero chance) Track length varies across disk Outside: More sectors per track, higher bandwidth Disk is organized into regions of tracks with same # of sectors/track Only outer half of radius is used Most of the disk area in the outer regions of the disk

Sectors Sectors contain sophisticated error correcting codes Disk head magnet has a field wider than track Hide corruptions due to neighboring track writes Sector sparing Remap bad sectors transparently to spare sectors on the same surface Slip sparing Remap all sectors (when there is a bad sector) to preserve sequential behavior Track skewing Sector numbers offset from one track to the next, to allow for disk head movement for sequential ops Error correcting code: ex: parity. But you can get more sophisticated.

Disk Performance Disk Latency = Seek + Rotation + Transfer Time Seek Time: time to move disk arm over track (1-20ms) Fine-grained position adjustment necessary for head to “settle” Head switch time ~ track switch time (on modern disks) Rotation Time: time to wait for disk to rotate under head Disk rotation: 4 – 15ms (depending on price of disk) On average, only need to wait half a rotation Transfer Time: time to transfer data onto/off of disk Disk head transfer rate: 50-100MB/s (5-10 usec/sector) Host transfer rate dependent on I/O connector (USB, SATA, …)

Toshiba Disk (2008)

Question 1 How long to complete 500 random disk reads, in FIFO order? Seek: average 10.5 msec Rotation: average 4.15 msec Transfer: at least 54 MB/s = 9.5 usec to transfer 512 bytes 500 * (10.5 + 4.15 + 0.0095)/1000 = 7.3 seconds

Question 2 How long to complete 500 sequential disk reads? Seek Time: 10.5 ms (to reach first sector) Rotation Time: 4.15 ms (to reach first sector) Transfer Time: (outer track) 500 sectors * 512 bytes / 128MB/sec = 2ms Total (outer tracks): 10.5 + 4.15 + 2 = 16.7 ms Might need an extra head or track switch (+1ms) Track buffer may allow some sectors to be read off disk out of order (-2ms)

Question 3 How large a transfer is needed to achieve 80% of the max disk transfer rate? Assume x rotations are needed, then solve for x: 0.8 (10.5 ms + (1ms + 8.5ms) x) = 8.5ms x Total: x = 9.1 rotations, 9.8MB

Disk Scheduling FIFO: Schedule disk operations in order they arrive Downsides? Poor performance for sequence of requests that alternate between outer and inner tracks

Disk Scheduling (cont.) Shortest Seek Time First (SSTF) Downsides? Not optimal! Starvation!

Disk Scheduling SCAN: move disk arm in one direction, until all requests satisfied, then reverse direction Also called “elevator scheduling”

Disk Scheduling (cont.) CSCAN: move disk arm in one direction, until all requests satisfied, then start again from farthest request

Disk Scheduling (cont.) R-CSCAN: CSCAN but take into account that short track switch is < rotational delay

Question How long to complete 500 random disk reads, in any order? Disk seek: 1ms (most will be short) Rotation: 4.15ms Transfer: 5-10usec Total: 500 * (1 + 4.15 + 0.01) = 2.2 seconds Would be a bit shorter with R-CSCAN vs. 7.3 seconds if FIFO order

Question How long to read all of the bytes off of a disk? Disk capacity: 320GB Disk bandwidth: 54-128MB/s Transfer time = Disk capacity / average disk bandwidth ~ 3500 seconds (1 hour)

Acknowledgment This lecture is a slightly modified version of the one prepared by Tom Anderson