Disk Scheduling CS 537 - Introduction to Operating Systems.

Slides:



Advertisements
Similar presentations
Overview of Mass Storage Structure
Advertisements

Silberschatz, Galvin and Gagne Operating System Concepts Disk Scheduling Disk IO requests are for blocks, by number Block requests come in an.
Disks Disk Hardware (1) Disk parameters for the original IBM PC floppy disk and a Western Digital WD hard disk.
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
Disk scheduling examples. Problem parameters: u Disk has 100 cylinders, labeled u Time to move from cylinder A to cylinder B is a linear function.
CPU Scheduling Questions answered in this lecture: What is scheduling vs. allocation? What is preemptive vs. non-preemptive scheduling? What are FCFS,
CSE506: Operating Systems Disk Scheduling. CSE506: Operating Systems Key to Disk Performance Don’t access the disk – Whenever possible Cache contents.
Input/Output Management and Disk Scheduling
University of Pennsylvania 10/24/00CSE 3801 Disk Scheduling CSE 380 Lecture Note 11a Insup Lee.
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (4) File Management & Input/Out Systems 10/14/2008 Yang Song (Prepared.
Disks.
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.
 Elevator Scheduling Lingfeng Luo Zhao Han. Elevator Scheduling Problem  Elevator as a control System  Behavior depends on programmed algorithms 
Disk and I/O Management
1 Recitation 8 Disk & File System. 2 Disk Scheduling Disks are at least four orders of magnitude slower than main memory –The performance of disk I/O.
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.
Chapter 4 Processor Management
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
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.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
CPU Scheduling Algorithms Simulation using Java Kaushal Sinha CSC 4320 Spring 2007.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
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.
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.
Scanf n, a, b /* I-O wait */ for (i=1; i
ITFN 2601 Introduction to Operating Systems Lecture 4 Scheduling.
Disks and Disk Scheduling Steve Muckle Monday, March 31st Spring 2003.
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.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 13 Mass-Storage Systems Slide 1 Chapter 13 Mass-Storage Systems.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 31 – Process Management (Part 1) Klara Nahrstedt Spring 2009.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
Device Management Mark Stanovich Operating Systems COP 4610.
Disk Average Seek Time. Multi-platter Disk platter Disk read/write arm read/write head.
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.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Elevator (Disk) Scheduling COMPSCI 210 Recitation 26th Oct 2012 Vamsi Thummala.
CPU Scheduling CS Introduction to Operating Systems.
Process Scheduling. Scheduling Strategies Scheduling strategies can broadly fall into two categories  Co-operative scheduling is where the currently.
CPU Scheduling Andy Wang Operating Systems COP 4610 / CGS 5765.
Chapter 10: Mass-Storage Systems
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Secondary Storage Secondary storage typically: Characteristics:
Disk Scheduling Algorithms
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
Lecture 45 Syed Mansoor Sarwar
Moving-head Disk Machanism
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
Operating System Concepts
Chapter 37 Hard Disk Drives
Disks and scheduling algorithms
Secondary Storage Management Brian Bershad
Persistence: hard disk drive
Chapter 11 I/O Management and Disk Scheduling
Slides by Prof. Landon Cox and Vamsi Thummala
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.
Disks and Storage Systems
Disks and Disk Scheduling
Secondary Storage Management Hank Levy
CSE451 File System Introduction and Disk Drivers Autumn 2002
ITEC 202 Operating Systems
Sarah Diesburg Operating Systems CS 3430
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

Disk Scheduling CS Introduction to Operating Systems

Disk Queues Each disk has a queue of jobs waiting to access disk –read jobs –write jobs Each entry in queue contains the following –pointer to memory location to read/write from/to –sector number to access –pointer to next job in the queue OS usually maintains this queue

Disk Queues Disk Sector X Mem Ptr 0 next entry Entry 1 Sector Y Mem Ptr 1 next entry Entry 2 Sector Z Mem Ptr 2 next entry Entry 3 head tail

First-In, First-Out (FIFO) Do accesses in the order in which they are presented to the disk This is very fair to processes This is very simple to implement Approximates random accesses to disk –gives rated, average latency for every read –will have large average seeks between each access Not a good policy

FIFO Reference String: 5, 35, 2, 14, 12, 21, 3, 9, 22, 20 head tail Calculation of total seek distance: =

FIFO Obviously, reordering the accesses to the disk could greatly reduce the seek distance –seek distance ~ seek time Want to put close accesses next to each other in the queue

Disk Scheduling Recall, statistical average seek time is 9 ms –randomly accessing all over disk Multiple requests to disk will arrive while one is being serviced Can drastically reduce average seek time by intelligent scheduling accesses

Shortest Seek Time First (SSTF) When a new job arrives, calculate its seek distance from the current job Place it in disk queue accordingly Service the next closest access when the current job finishes

SSTF Reference String: 5, 35, 2, 14, 12, 21, 3, 9, 22, 20 head tail Calculation of total seek distance: =

SSTF Provides substantial improvement in seek time over FCFS One major issue –STARVATION What if some accesses are on far end of disk from current access –jobs are constantly arriving in a real system –jobs closest to the current access will keep getting serviced –jobs on the far end will starve

Elevator Algorithm Similar to SSTF One major difference –next job scheduled is closest to current job but in one particular direction –all jobs in other direction are put at the end of the list Similar to an elevator –it goes up first and then comes back down

Elevator Algorithm Reference String: 5, 35, 2, 14, 12, 21, 3, 9, 22, 20 head tail Calculation of total seek distance: =

Elevator Algorithm Avoids starvation Provides very good performance Still has one major issue –FAIRNESS Jobs in the middle of the disk get serviced twice as much as jobs at the ends

One-Way Elevator Algorithm Exactly like elevator algorithm except scheduling is done in only one direction –for example, elevator always goes “up” This will require one long seek after finished going up –have to go back to the beginning This is okay because one long seek doesn’t take very long –IBM disk: 15 ms from one end to the other This long seek is done infrequently

One-Way Elevator Algorithm Reference String: 5, 35, 2, 14, 12, 21, 3, 9, 22, 20 head tail Calculation of total seek distance: =