Disks and Disk Scheduling Steve Muckle Monday, March 31st 2003 15-412 Spring 2003.

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
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
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.
University of Pennsylvania 10/24/00CSE 3801 Disk Scheduling CSE 380 Lecture Note 11a Insup Lee.
Lecture 17 I/O Optimization. Disk Organization Tracks: concentric rings around disk surface Sectors: arc of track, minimum unit of transfer Cylinder:
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.
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.
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
MM File Management Karrie Karahlaios and Brian P. Bailey Spring 2007.
CS4432: Database Systems II Data Storage (Better Block Organization) 1.
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.
1 6 Further System Fundamentals (HL) 6.2 Magnetic Disk Storage.
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.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space.
15-410, S’ Disks Mar. 24, 2004 Dave Eckhardt & Bruce Maggs Brian Railing & Steve Muckle Contributions from Eno Thereska “How Stuff Works”
Disk Basics CS Introduction to Operating Systems.
Disk Scheduling CS Introduction to Operating Systems.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
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.
M ASS S TORAGE S TRUCTURES Lecture: Operating System Concepts Lecturer: Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Presentation-4 Group-A1 Professor Mohamed Khalil Anita Kanuganti Hemanth Rao.
Device Management Andy Wang Operating Systems COP 4610 / CGS 5765.
1 Components of the Virtual Memory System  Arrows indicate what happens on a lw virtual address data physical address TLB page table memory cache disk.
Chapter 10: Mass-Storage Systems
Operating System (013022) Dr. H. Iwidat
Disks and RAID.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
OPERATING SYSTEMS CS 3502 Fall 2017
Secondary Storage Secondary storage typically: Characteristics:
Hard Drives.
Disk Scheduling Algorithms
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
Research on Disks and Disk Scheduling
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.
Disks and scheduling algorithms
Secondary Storage Management Brian Bershad
Persistence: hard disk drive
Disks and Disk Scheduling
Secondary Storage Management Hank Levy
CSE451 File System Introduction and Disk Drivers Autumn 2002
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

Disks and Disk Scheduling Steve Muckle Monday, March 31st Spring 2003

Carnegie Mellon University2 Overview Project Discussion Anatomy of a Hard Drive Common Disk Scheduling Algorithms Freeblock Scheduling

Carnegie Mellon University3 Project Discussion (3) Project 3 is over! War stories? Sage advice? Sign ups for interviews will begin soon Watch bboard

Carnegie Mellon University4 Project Discussion (4) File System project out today Lots of code Planning will save you pain and suffering Read it tonight (this afternoon even!)

Carnegie Mellon University5 Anatomy of a Hard Drive On the outside, a hard drive looks like this Taken from “How Hard Disks Work”

Carnegie Mellon University6 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”

Carnegie Mellon University7 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”

Carnegie Mellon University8 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”

Carnegie Mellon University9 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”

Carnegie Mellon University10 Anatomy of a Hard Drive How are the surfaces organized? a surface

Carnegie Mellon University11 Anatomy of a Hard Drive Each surface is divided by concentric circles, creating tracks tracks

Carnegie Mellon University12 Anatomy of a Hard Drive The matching tracks on all surfaces are collectively called a cylinder

Carnegie Mellon University13 Anatomy of a Hard Drive These tracks are further divided into sectors

Carnegie Mellon University14 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 a sector

Carnegie Mellon University15 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

Carnegie Mellon University16 Anatomy of a Hard Drive Why don’t we read in a sector from the disk read/write head desired sector disk rotates counter-clockwise

Carnegie Mellon University17 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

Carnegie Mellon University18 Anatomy of a Hard Drive Why don’t we read in a sector from the disk read/write head

Carnegie Mellon University19 Anatomy of a Hard Drive Why don’t we read in a sector from the disk read/write head

Carnegie Mellon University20 Anatomy of a Hard Drive Why don’t we read in a sector from the disk read/write head

Carnegie Mellon University21 Anatomy of a Hard Drive Why don’t we read in a sector from the disk read/write head

Carnegie Mellon University22 Anatomy of a Hard Drive Why don’t we read in a sector from the disk read/write head

Carnegie Mellon University23 Anatomy of a Hard Drive Why don’t we read in a sector from the disk read/write head

Carnegie Mellon University24 Anatomy of a Hard Drive Why don’t we read in a sector from the disk read/write head

Carnegie Mellon University25 Anatomy of a Hard Drive Why don’t we read in a sector from the disk read/write head

Carnegie Mellon University26 Anatomy of a Hard Drive Why don’t we read in a sector from the disk read/write head

Carnegie Mellon University27 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 We will also have to wait half a rotation The time to do this is rotational latency, and on a 5400 rpm drive is ~5.5ms

Carnegie Mellon University28 Anatomy of a Hard Drive There are two other things that determine overall disk access time - 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 They are both fairly minor compared to seek time and rotational latency

Carnegie Mellon University29 Anatomy of a Hard Drive Total drive random access time is on the order of 15 to 20 milliseconds Oh man, disks are slow What can we, as operating system programmers, do about this?

Carnegie Mellon University30 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

Carnegie Mellon University31 First Come First Served (FCFS) Requests are sent to the disk as they are generated by the OS Trivial to implement Fair – no request will be starved because of its location on the disk Provides an unacceptably high mean response time …except for project four!

Carnegie Mellon University32 Shortest Seek Time First (SSTF) Always send the request with the shortest seek time from current head position Generates very fast response time Intolerable response time variance, however Why?

Carnegie Mellon University33 SCAN Send requests in ascending cylinders When last cylinder is reached, reverse the scan Mean response time is worse than SSTF, but better than FCFS Better response time variance than SSTF Unfair – why?

Carnegie Mellon University34 LOOK Just like SCAN – sweep back and forth through cylinders If there are no more requests in our current direction we reverse course Improves mean response time, variance Still unfair though

Carnegie Mellon University35 CSCAN Send requests in ascending (or descending) cylinders When the last cylinder is reached, seek all the way back to the beginning Long seek is amortized across all accesses Variance is improved Fair Still missing something though…

Carnegie Mellon University36 C-LOOK CSCAN + LOOK Only scan in one direction, as in CSCAN If there are no more requests in current direction reverse course Very popular

Carnegie Mellon University37 Shortest Positioning Time First (SPTF) Similar to Shortest Seek Time First Always select request with shortest total positioning time (rotational latency + seek time) More accurate greedy algorithm than SSTF Same starvation problems

Carnegie Mellon University38 Weighted Shortest Positioning Time First (WSPTF) SPTF, but we age requests to prevent starvation Aging policy is very flexible Excellent performance Why don’t we use this?

Carnegie Mellon University39 Freeblock Scheduling Research going on right here at CMU Something I am involved in this semester Who would like some free bandwidth while their disk is busy?

Carnegie Mellon University40 Freeblock Scheduling We have settled on a disk scheduling routine (probably C-LOOK) We have a queue of disk requests Let’s take a closer look at a pair of possible disk requests

Carnegie Mellon University41 Freeblock Scheduling There are two requests at the disk read/write head first request second request

Carnegie Mellon University42 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University43 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University44 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University45 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University46 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University47 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University48 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University49 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University50 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University51 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University52 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University53 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University54 Freeblock Scheduling There are two requests at the disk read/write head

Carnegie Mellon University55 Freeblock Scheduling As in SPTF scheduling, we must know the EXACT state of the disk We need to be able to predict how much rotational latency we have to work with Enemies of freeblock scheduling: disk prefetching internal disk cache hits unexpected disk activity (recalibration, etc) disk-reordered requests

Carnegie Mellon University56 Freeblock Scheduling Results include 3.1MB/sec of free bandwidth This free bandwidth is best suited to applications with loose time constraints Some sample applications: - backup applications - disk array scrubbing - cache cleaning (perhaps…)

Carnegie Mellon University57 Read the project 4 handout!