Input/Output Management and Disk Scheduling

Slides:



Advertisements
Similar presentations
I/O Systems & Mass-Storage Systems
Advertisements

I/O Management and Disk Scheduling
I/O Management and Disk Scheduling
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
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.
Chapter 4 Device Management and Disk Scheduling DEVICE MANAGEMENT Content I/O device overview I/O device overview I/O organization and architecture I/O.
I/O Management and Disk Scheduling
I/O Management and Disk Scheduling
Categories of I/O Devices
I/O Management and Disk Scheduling
Disk Scheduling Based on the slides supporting the text 1.
OPERATING SYSTEMS CS3530 Summer 2014 OPERATING SYSTEMS CS3530 Summer 2014 Input/Output System Chapter 9.
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.
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
Based on the slides supporting the text
1 Chapter 11 I/O Management and Disk Scheduling –Operating System Design Issues –I/O Buffering –Disk Scheduling –Disk Cache.
I/O Management and Disk Scheduling (Chapter 10) Perhaps the messiest aspect of operating system design is input/output A wide variety of devices and many.
Lecture 11: I/O Management and Disk Scheduling. Categories of I/O Devices Human readable –Used to communicate with the user –Printers –Video display terminals.
Disks.
Device Management.
1 Disk Scheduling Chapter 14 Based on the slides supporting the text.
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
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
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.
I/O Management and Disk Scheduling
Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13+14: I/O Systems and Mass- Storage Structure I/O Hardware Application I/O.
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.
1 IO Management and Disk Scheduling Chapter Categories of I/O Devices n Human readable u used to communicate with the user u video display terminals.
1 I/O Management and Disk Scheduling Chapter
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable  Used to communicate with the user  Printers  Video display.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
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.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable –Used to communicate with the user –Printers –Video display.
O VERVIEW OF M ASS S TORAGE S TRUCTURE Magnetic disks provide bulk of secondary storage of modern computers Drives rotate at 60 to 250 times per second.
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.
Fall 2000M.B. Ibáñez Lecture 25 I/O Systems. Fall 2000M.B. Ibáñez Categories of I/O Devices Human readable –used to communicate with the user –video display.
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.
OPERATING SYSTEMS IO SYSTEMS. Categories of I/O Devices Human readable –Used to communicate with the user –Printers –Video display terminals Display Keyboard.
I/O Management and Disk Scheduling Chapter 11. Categories of I/O Devices Human readable Used to communicate with the user  Printers, Display terminals,
1 I/O Management and Disk Scheduling Chapter I/O Devices Can be group into three categories: 1.Human readable Used to communicate with the computer.
I/O Devices. Characteristics of I/O Devices  Block Devices  Information are stored and accessed in fixed-size blocks  Addressable, can have sequential.
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.
© 2004, D. J. Foreman 1 Device Mgmt. © 2004, D. J. Foreman 2 Device Management Organization  Multiple layers ■ Application ■ Operating System ■ Driver.
Device Management Mark Stanovich Operating Systems COP 4610.
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.
Chapter 101 I/O Management and Disk Scheduling Chapter 11.
Device Management Andy Wang Operating Systems COP 4610 / CGS 5765.
Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Sarah Diesburg Operating Systems CS 3430
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Operating System I/O System Monday, August 11, 2008.
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
Chapter 14 Based on the slides supporting the text
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
Overview Continuation from Monday (File system implementation)
Chapter 11 I/O Management and Disk Scheduling
Outline Device Management Device Manager Design Buffering
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
ITEC 202 Operating Systems
Andy Wang Operating Systems COP 4610 / CGS 5765
Presentation transcript:

Input/Output Management and Disk Scheduling Chapter 11 Chapter 11

Categories of I/O devices Human-readable: printers video display keyboard... Machine Readable: disk, tape sensors... Communication line drivers modems... Chapter 11

Main Characteristics Data rate (bits or bytes?) Unit of transfer (bit, byte, or block) Data format Error conditions Interrupt signaling Chapter 11

Varying data rates.... Chapter 11

Stages of Evolution No interrupts With interrupts Simple programmed I/O by CPU Add simple controller to this: channel; busy waiting or polling needed CPU keeps asking channel whether it has finished With interrupts Add interrupts to this simultaneous operation CPU & I/O traffic I/O  Memory still goes through CPU Introduce DMA: a controller to minimize CPU involvement. CPU interrupted only after entire block has been transferred DMA has complex instruction set (e.g. “if”) DMA is complete separate CPU Chapter 11

Direct Memory Access Takes control of the system from the CPU to transfer data to and from memory over the system bus Cycle stealing is used to transfer data on the system bus CPU slowed down, but not as much as it would be without DMA The CPU pauses one bus cycle to allow DMA to do its work No interrupts occur until all data block transferred Chapter 11

Possible DMA configuration 1 (communication unit/DMA involves bus: inefficient) Chapter 11

Possible DMA configuration 2 (communication betw Possible DMA configuration 2 (communication betw. DMA and unit does not involve bus) Chapter 11

Possible DMA configuration 3 (very flexible, facilitates the inclusion of additional I/O units) Chapter 11

OS Design Issues Efficiency Generality: I/O is usually the bottleneck! Extremely slow with respect to CPU Generality: Try to handle devices as much as possible in same manner Use general-purpose primitives, hide peculiarities of devices from high-level modules every file can be treated in terms of read. write, open, close, lock, unlock... Chapter 11

Lower levels hide details from higher ones Layering Models Lower levels hide details from higher ones Chapter 11

I/O Buffering Could buffer be in memory area of user process? Probably not. Process in execution is subject to paging, suspension, etc. so I/O must occur in a separate memory area (next solution) Chapter 11

I/O Buffering Block-Oriented Stream-oriented Information is stored in fixed sized blocks Transfers are made a block at the time Used for disks and tapes Stream-oriented Information unit is of variable size: a stream of bytes special info, such as carriage return, will delimit its logical parts Used for terminals, printers, communication ports, mouse and most other devices that are not secondary storage Chapter 11

Single Buffer Block-oriented Input transfers made to buffer As soon as user takes data, new input can start (similarly for output) Read ahead, output and go (no wait) Chapter 11

Shadow Double buffering More independence between I/O and processing: a process can use the content of one buffer while the I/O device works with the other buffer Normally invisible to programmer. Chapter 11

Circular buffer Generalized scheme, such as in the producer-consumer problem Sometimes the I/O device can be faster, other times the user process can be faster Peak demands are smoothed out Chapter 11

Disk scheduling Cylinder: the set of tracks that are in the same position with respect to read/write head (but book only considers tracks, not cylinders) Chapter 11 Silberschatz

Disk performance parameters To read or write, the disk head must be positioned at the desired track and at the beginning of the desired sector Access time is the sum of: Seek time time it takes to position the head at the desired track (or cylinder) Rotational delay or rotational latency time its takes for the beginning of the sector to reach the head Transfer time Seek time >> Rotational Delay >> Transfer time Chapter 11

Chapter 11

Tracks and cylinders Chapter 11

Chapter 11

Timing of a Disk I/O Transfer Chapter 11

Disk Scheduling Policies Seek time is the reason for differences in performance Seek time >> Rotational latency For a single disk there will be a number of I/O requests If requests are selected randomly, we will not get a good performance we will assume that the requests for disk access of a number of user will be random (but for a single user `locality of reference’ will again hold) So it is important to devise better methods: I/O system sorts the requests in some way Chapter 11

Evaluating the policies To evaluate the policies, we will use a random sequence of track accesses (see book): Starting at track 100 and then 55 58 39 18 90 160 150 38 184 and calculate how many track traversal each policy will require to finish the sequence Chapter 11

FIFO policy: process requests in the order they arrive 55 58 39 18 90 160 150 38 184 FIFO policy: process requests in the order they arrive From 100 to 55: 45 tracks traversed From 55 to 58: 3 tracks traversed From 58 to 39: 19 tracks traversed etc etc.... In total: 45+3+19... = 498 tracks 498 / 9 = 55.3 tracks traversed for the avg request Chapter 11

The Shortest Service Time First policy (SSTF) This policy looks each time at the queue of the waiting requests and chooses the one that can be served with the shortest seek from the current position. From 100 to 90: 10 tracks From 90 to 58: 32 From 58 to 55: 3 In total: 10+32+3... = 248 / 9 = 27.5 better! 55 58 39 18 90 160 150 38 184 90 58 55 39 38 18 150 160 184 Chapter 11

The SCAN (or elevator) policy Problem with the previous policy: it is possible that some requests will starve, because closer requests keep arriving!! Solution: keep going in one direction until all requests are satisfied. Then change direction, and so on 100  150 = 50; 150  160 = 10; 160  184 = 24; 184  90 = 94.... 50+10+24+94+.... = 250 / 9 = 27.8 a bit worse than SSTF but no starvation 55 58 39 18 90 160 150 38 184 150 160 184 90 58 55 39 38 18 Chapter 11

C-SCAN (Circular SCAN) Similar behavior to SSTF Problem with the previous policy: nothing to do immediately after the arm reverses direction (already done) waiting requests will be at the other end C-SCAN: assumes that return trip to track is rapid (as it is in many drivers) Disk is always scanned in one direction only When the scan is complete, arm goes back to the beginning and restarts Chapter 11

C-SCAN (Circular SCAN) 55 58 39 18 90 160 150 38 184 150 160 184 18 38 39 55 58 90 If the return home is considered as 184-18=166 then the average seek length is 35.8. If it is considered 0, then 136 / 9 = 15 (only!) In practice, it will be closer to 35 than to 15. return home 184 18 Chapter 11

Last in, First Out (LIFO) Serve always the most recent request first! Rationale: keep serving the same user may result in accessing nearby tracks certainly true if file is sequential applies the principle of locality to disk accesses But may starve early users Chapter 11

Chapter 11

In practice... For a realistic evaluation of disk times, one cannot assume simply that traversal of one track takes one unit of time One must consider real arm motion times, which include a start time when the head picks up speed One must also consider rotational delay and read times Such times vary from disk unit to disk unit Chapter 11

Important Concepts of Chapter 11 Different types of I/O Devices Different types of I/O Processing Direct Memory Access Buffering Characteristics of disk units Access time Different disk scheduling algorithms comparison Chapter 11