15-410, S’04 - 61 - Disks Mar. 24, 2004 Dave Eckhardt & Bruce Maggs Brian Railing & Steve Muckle Contributions from Eno Thereska 15-213 “How Stuff Works”

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

Overview of Mass Storage Structure
I/O Management and Disk Scheduling
Disk Scheduling Based on the slides supporting the text 1.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
CSE506: Operating Systems Disk Scheduling. CSE506: Operating Systems Key to Disk Performance Don’t access the disk – Whenever possible Cache contents.
OPERATING SYSTEMS CS3530 Summer 2014 OPERATING SYSTEMS CS3530 Summer 2014 Input/Output System Chapter 9.
Lecture 14 I/O Devices & Hard Disk Drives. vgetmem only from private heap.
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
Based on the slides supporting the text
Chapter 12 – Disk Performance Optimization Outline 12.1 Introduction 12.2Evolution of Secondary Storage 12.3Characteristics of Moving-Head Disk Storage.
Disks.
1 Disk Scheduling Chapter 14 Based on the slides supporting the text.
12: IO Systems1 I/O SYSTEMS This Chapter is About Processor I/O Interfaces: Connections exist between processors, memory, and IO devices. The OS must manage.
Avishai Wool lecture Introduction to Systems Programming Lecture 9 Input-Output Devices.
Secondary Storage CSCI 444/544 Operating Systems Fall 2008.
04/21/2004CSCI 315 Operating Systems Design1 Disk Scheduling.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
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
MM File Management Karrie Karahlaios and Brian P. Bailey Spring 2007.
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.
Topic: Disks – file system devices. Rotational Media Sector Track Cylinder Head Platter Arm Access time = seek time + rotational delay + transfer time.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo1 Disk & disk scheduling.
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.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
Chapter 12: Mass-Storage Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 12: Mass-Storage.
Disks and Storage Systems
1Fall 2008, Chapter 12 Disk Hardware Arm can move in and out Read / write head can access a ring of data as the disk rotates Disk consists of one or more.
CE Operating Systems Lecture 20 Disk I/O. Overview of lecture In this lecture we will look at: Disk Structure Disk Scheduling Disk Management Swap-Space.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
Lecture 3 Page 1 CS 111 Online Disk Drives An especially important and complex form of I/O device Still the primary method of providing stable storage.
Disks and Disk Scheduling Steve Muckle Monday, March 31st Spring 2003.
Disk Basics CS Introduction to Operating Systems.
1.  Disk Structure Disk Structure  Disk Scheduling Disk Scheduling  FCFS FCFS  SSTF SSTF  SCAN SCAN  C-SCAN C-SCAN  C-LOOK C-LOOK  Selecting a.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 13 Mass-Storage Systems Slide 1 Chapter 13 Mass-Storage Systems.
Chapter 14: Mass-Storage
Device Management Mark Stanovich Operating Systems COP 4610.
Disk Average Seek Time. Multi-platter Disk platter Disk read/write arm read/write head.
Chapter 9 I/O System. 2 Input/Output System I/O Major objectives are: Take an application I/O request and send it to the physical device. Then, take whatever.
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
1 Chapter 13 Mass-Storage Structure. 2 Disk Structure Disk drives are addressed as large 1- dimensional arrays of logical blocks, where the logical block.
Presentation-4 Group-A1 Professor Mohamed Khalil Anita Kanuganti Hemanth Rao.
Device Management Andy Wang Operating Systems COP 4610 / CGS 5765.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems DISK I/0.
Chapter 10: Mass-Storage Systems
Sarah Diesburg Operating Systems CS 3430
Disks and RAID.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
OPERATING SYSTEMS CS 3502 Fall 2017
Hard Drives.
Disk Scheduling Algorithms
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
CSE 451: Operating Systems Autumn 2003 Lecture 12 Secondary Storage
Disks and scheduling algorithms
Secondary Storage Management Brian Bershad
Persistence: hard disk drive
Persistence: I/O devices
Chapter 11 I/O Management and Disk Scheduling
CSE 451: Operating Systems Winter 2003 Lecture 12 Secondary Storage
Disks and Storage Systems
Disks and Disk Scheduling
Secondary Storage Management Hank Levy
CSE451 File System Introduction and Disk Drivers Autumn 2002
Andy Wang Operating Systems COP 4610 / CGS 5765
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

15-410, S’ Disks Mar. 24, 2004 Dave Eckhardt & Bruce Maggs Brian Railing & Steve Muckle Contributions from Eno Thereska “How Stuff Works” web site L22_Disks “...What goes around comes around...”

15-410, S’ Synchronization Project 3 status Checkpoint 1 – not what we had hoped for Checkpoint 2 – most people caught upSuggestions Three regular meeting times per week Two hours or more at each meeting Begin by asking questions about each other's code » Requires having read code before meeting » Requires “quiet time” between check-ins and meeting Source control Frequent merges, not a single “big bang” at end Leave time at end for those multi-day bugs

15-410, S’ Overview Anatomy of a Hard Drive Common Disk Scheduling Algorithms

15-410, S’ Anatomy of a Hard Drive On the outside, a hard drive looks like this Taken from “How Hard Disks Work”

15-410, S’ Anatomy of a Hard Drive If we take the cover off, we see that there actually is a “hard disk” inside Taken from “How Hard Disks Work”

15-410, S’ Anatomy of a Hard Drive A hard drive usually contains multiple disks, called platters These spin at thousands of RPM (5400, 7200, etc) Taken from “How Hard Disks Work”

15-410, S’ Anatomy of a Hard Drive Information is written to and read from the platters by the read/write heads on the disk arm Taken from “How Hard Disks Work”

15-410, S’ Anatomy of a Hard Drive Both sides of each platter store information Each side of a platter is called a surface Each surface has its own read/write head Taken from “How Hard Disks Work”

15-410, S’ Anatomy of a Hard Drive How are the surfaces organized? a surface

15-410, S’ Anatomy of a Hard Drive Each surface is divided by concentric circles, creating tracks tracks

15-410, S’ Anatomy of a Hard Drive These tracks are further divided into sectors

15-410, S’ Anatomy of a Hard Drive A sector is the smallest unit of data transfer to or from the disk Most modern hard drives have 512 byte sectors CD-ROM sectors are 2048 bytes Gee, those outer sectors look bigger... a sector

15-410, S’ Anatomy of a Hard Drive Does this mean that sectors on the outside of a surface are larger than those on the inside? Modern hard drives fix this with zoned bit recording Taken from “Reference Guide – Hard Disk Drives”

15-410, S’ Anatomy of a Hard Drive Let's read in a sector from the disk read/write head desired sector disk rotates counter-clockwise

15-410, S’ Anatomy of a Hard Drive We need to do two things to transfer a sector 1. Move the read/write head to the appropriate track (seek) 2. Wait until the desired sector spins around

15-410, S’ Anatomy of a Hard Drive Let's read in a sector from the disk read/write head

15-410, S’ Anatomy of a Hard Drive Let's read in a sector from the disk read/write head

15-410, S’ Anatomy of a Hard Drive Let's read in a sector from the disk read/write head

15-410, S’ Anatomy of a Hard Drive Let's read in a sector from the disk read/write head

15-410, S’ Anatomy of a Hard Drive Let's read in a sector from the disk read/write head

15-410, S’ Anatomy of a Hard Drive Let's read in a sector from the disk read/write head

15-410, S’ Anatomy of a Hard Drive Let's read in a sector from the disk read/write head

15-410, S’ Anatomy of a Hard Drive Let's read in a sector from the disk read/write head

15-410, S’ Anatomy of a Hard Drive Let's read in a sector from the disk read/write head

15-410, S’ Disk Cylinder Matching tracks across surfaces are collectively called a cylinder

15-410, S’ Disk Cylinder Matching tracks form a cylinder. Matching tracks form a cylinder. surface 0 surface 1 surface 2 surface 3 surface 4 surface 5 cylinder k spindle platter 0 platter 1 platter 2

15-410, S’ Cheap Access Within A Cylinder Heads on single arm All heads always on same cylinder Switching heads is “cheap” Deactive head 3 Activate head 4 Wait for 1 st sector header Optimal transfer rate Transfer all sectors on a track Transfer all tracks on a cylinder Then move elsewhere

15-410, S’ Anatomy of a Hard Drive On average, we will have to move the read/write head over half the tracks The time to do this is the “average seek time”, and is ~10ms for a 5400 rpm disk We will also must wait half a rotation The time to do this is rotational latency, and on a 5400 rpm drive is ~5.5ms

15-410, S’ Anatomy of a Hard Drive Other factors influence overall disk access time including Settle time, the time to stabilize the read/write head after a seek Command overhead, the time for the disk to process a command and start doing something Minor compared to seek time and rotational latency

15-410, S’ Anatomy of a Hard Drive Total drive random access time is on the order of 15 to 20 milliseconds 50 ½-kilobyte transfers per second = 25 Kbyte/sec Oh man, disks are slow But wait! Disk transfer rates are tens of MBytes/sec What can we, as operating system programmers, do about this? Read more per seek (multi-sector transfers) Don't seek so randomly (“disk scheduling”)

15-410, S’ Disk Scheduling Algorithms The goal of a disk scheduling algorithm is to be nice to the disk We can help the disk by giving it requests that are located close to each other on the disk This minimizes seek time, and possibly rotational latency There exist a variety of ways to do this

15-410, S’ Disk Scheduling Algorithms What the OS knows about the disk? Logical Block Numbers Interface: IDE or SCSI What happened to sectors, tracks, etc? They are hidden behind the logical block numbers How are they used? File systems assign logical blocks to files

15-410, S’ First Come First Served (FCFS) Send requests to disk as they are generated by the OS Trivial to implement – FIFO queue in device driver Fair “Unacceptably high mean response time” File “abc” in sectors 1, 2, 3,... File “def” in sectors 16384, 16385, 16386,... Sequential reads: 1, 16384, 2, 16385, 3, “Fair, but cruel”

15-410, S’ Shortest Seek Time First (SSTF) Maintain “queue” of disk requests Serve the request nearest to the disk arm Easy to estimate by difference in block numbers Generates very fast response time Intolerable response time variance, however Why?

15-410, S’ What Went Wrong? FCFS - “fair, but cruel” Ignores position of disk arm, very slow SSTF – good throughput, very unfair Ignores need to eventually scan entire disk “Scan entire disk” - now that's an idea! Start disk arm moving in one direction Serve requests as the arm moves past them No matter what order they arrived in When arm bangs into stop, reverse direction

15-410, S’ SCAN Doubly-linked ordered list of requests Insert according to order Bi-directional scanning Direction = +1 or -1 Tell disk: “seek to cylinder X=current+direction” Examine list for requests in cylinder X If X == 0 or X == max, direction = -direction Else current = X

15-410, S’ Evaluating SCAN Mean response time Worse than SSTF, better than FCFS Response time variance Better than SSTF Unfair – why?

15-410, S’ LOOK Just like SCAN – sweep back and forth through cylinders Don't wait for the “thud” to reverse the scan Reverse when there are no requests “ahead” of the arm Improves mean response time, variance Still unfair though

15-410, S’ CSCAN- “Circular SCAN” Send requests in ascending cylinder order When the last cylinder is reached, seek all the way back to the first cylinder Long seek is amortized across all accesses Variance is improved Fair Still missing something though…

15-410, S’ C-LOOK CSCAN + LOOK Scan in one direction, as in CSCAN If there are no more requests in current direction go back to furthest request Very popular

15-410, S’ C-LOOK Blue are requests Yellow is disk Red is disk head Green is completed requests Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers New Request

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers In SCAN, I would continue to the right until the end of the disk

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers In LOOK, we would have read this request

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ C-LOOK Higher Block Numbers

15-410, S’ Shortest Positioning Time First (SPTF) Key observation Seek time takes a while But rotation time is comparable! Short seeks are faster than whole-disk rotations What matters is positioning time, not seek time SPTF is like SSTF Serve “temporally nearest” sector nextChallenge Can't estimate by subtracting sector numbers Must know rotation position of disk in real time! Performs better than SSTF, but still starves requests

15-410, S’ Weighted Shortest Positioning Time First (WSPTF) SPTF plus fairness Requests are “aged” to prevent starvation Compute “temporal distance” to each pending request Subtract off “age factor” Result: sometimes serve old request, not closest request Various aging policies possible, many work fine Excellent performance Like SPTF, hard for OS to know disk status in real time On-disk schedulers can manage this, though...

15-410, S’ Conclusions Disks are complicated Disks are very slow FCFS is a very bad idea C-LOOK is ok in practice Disks probably do something like WSPTF internally