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.

Slides:



Advertisements
Similar presentations
I/O Management and Disk Scheduling
Advertisements

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.
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.
Chapter 11 I/O Management and Disk Scheduling
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
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
Chapter 11 I/O Management and Disk Scheduling
I/O Management and Disk Scheduling
Categories of I/O Devices
Disk Scheduling Based on the slides supporting the text 1.
Computer System Overview
Input/Output Management and Disk Scheduling
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.
Ceng Operating Systems 5-1 Chapter 5 : Input & Output I/O hardware (classification, device drivers) I/O techniques (programmed, interrupt driven,
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.
CS623: Lecture 4 2/17/2004 © Joel Wein 2003, modified by T. Suel.
I/O Management and Disk Scheduling Chapter 11. Categories: For Human interaction : Printers, terminals, keyboard, mouse Machine readable: Disks, Sensors,
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
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.
Chapter 5 : Input & Output
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.
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.
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.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
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.
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.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
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.
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.
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.
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.
I/O Management and Disk Scheduling
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Secondary Storage Secondary storage typically: Characteristics:
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.
Chapter 37 Hard Disk Drives
Chapter 11 I/O Management and Disk Scheduling
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.
ITEC 202 Operating Systems
Lecture 10: Magnetic Disks
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

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 –Data representation –Error conditions

Categories of devices that engage in I/O Human readable e.g. printer, mouse Human readable e.g. printer, mouse Machine readable e.g. tape, disk Machine readable e.g. tape, disk Communication devices e.g. modem Communication devices e.g. modem

Organization of the I/O function Programmed I/O Programmed I/O –Program busy-waits while waiting for I/O device to respond. Interrupt-driven I/O Interrupt-driven I/O –I/O devices have the capacity to interrupt the processor and therefore allow the processor to run other processes while waiting for I/O device to respond.

Organization of the I/O function Direct Memory Access Direct Memory Access –Uses interrupts to communicate with the processor. –Assists with transfer of large amounts of data.

DMA Processor sends a DMA request. Processor sends a DMA request. –Read or write data from I/O device. –Which I/O device –Starting address in memory. –Number of words to transfer Processor gets an ACK from DMA controller. Processor gets an ACK from DMA controller. Processor does other work. Processor does other work. DMA transfers the data. DMA transfers the data. –It occasionally cycle steals i.e. causes the processor memory cycle to stall while it uses the memory bus to transfer data. When done, the controller interrupts the processor. When done, the controller interrupts the processor.

Operating system requirements to handle I/O devices Efficiency Efficiency –I/O devices are slow. –Use multi-programming. –Suspend processes. Generality Generality –Handle all devices in a uniform manner. –Use an hierarchical model. The layers further down the hierarchy (away from the OS) are more device specific. The layers further down the hierarchy (away from the OS) are more device specific.

Disk scheduling To read or write, the disk head must be positioned at the desired track and at the beginning of the desired sector To read or write, the disk head must be positioned at the desired track and at the beginning of the desired sector Seek time Seek time –time it takes to position the head at the desired track Initial startup time Initial startup time Time to traverse tracks Time to traverse tracks Rotational delay or rotational latency Rotational delay or rotational latency –time its takes for the beginning of the sector to reach the head

Disk scheduling The order in which the disk requests are made affects the time it takes to traverse the sectors and hence the seek time. The order in which the disk requests are made affects the time it takes to traverse the sectors and hence the seek time. Disk scheduling aims at reducing the traversal time. Disk scheduling aims at reducing the traversal time.

Number of tracks = 200 Current position of head is track 100 Request sequence: 55,58,39,18,90,160,150,38,184 FIFO

Priority Decision made outside of the disk management software. Decision made outside of the disk management software. Give priority to shorter jobs, interactive jobs. Give priority to shorter jobs, interactive jobs.

Last In First Out Satisfy the most recent request. Satisfy the most recent request. In systems that do sequential processing, will require less arm movement. In systems that do sequential processing, will require less arm movement. Could result in starvation. Could result in starvation.

Shortest Service Time First Least movement of the disk arm from its current position Least movement of the disk arm from its current position Starvation possible Starvation possible

Number of tracks = 200 Current position of head is track 100 Request sequence: 55,58,39,18,90,160,150,38,184

SCAN (Elevator) Eliminate starvation Eliminate starvation Move the arm in one direction, until there are no more tracks or no more requests in that direction (LOOK) Move the arm in one direction, until there are no more tracks or no more requests in that direction (LOOK) Reverse direction and repeat Reverse direction and repeat Does not exploit locality. Does not exploit locality. –Biased against the most recently used tracks. Favors the innermost and outermost tracks. Favors the innermost and outermost tracks.

Number of tracks = 200 Current position of head is track 100 Request sequence: 55,58,39,18,90,160,150,38,184

C-SCAN (Circular) Service requests only in one direction. (Use LOOK to stop) Service requests only in one direction. (Use LOOK to stop) Reduces the maximum delay experienced by new requests. Reduces the maximum delay experienced by new requests.

N-step-SCAN Arm-stickiness occurs with SCAN and C- SCAN Arm-stickiness occurs with SCAN and C- SCAN Split the queue into smaller queues of length N Split the queue into smaller queues of length N While servicing a sub-queue, new requests are added to another sub-queue. While servicing a sub-queue, new requests are added to another sub-queue. Must completely service a sub-queue before moving to another sub-queue. Must completely service a sub-queue before moving to another sub-queue.

Example Requests Requests –2,98,55,34,45,23,24,25,26,27,…. (Scheduled with SCAN) (Scheduled with SCAN) –2, 23, 24, 25, 26, 27,……, 34, 45, 55, 98 N = 4 (Scheduled with N-step-SCAN) N = 4 (Scheduled with N-step-SCAN) –2, 98, 55, 34 (2, 34, 55, 98) –45, 23, 24, 25 (45, 25, 24, 23) –26, 27 (26, 27)

FSCAN Maintain two sub-queues Maintain two sub-queues While servicing one sub-queue, add new requests to the other. While servicing one sub-queue, add new requests to the other. Service of new requests deferred until all old requests have been processed Service of new requests deferred until all old requests have been processed

Disk scheduling in Linux

Elevator Elevator –Long delays possible. Processes don’t have to wait for writes to complete. Processes don’t have to wait for writes to complete. Three queues (Deadline scheduler) Three queues (Deadline scheduler) –Elevator (sorted) –Write requests (expiration time = 5s) –Read requests (expiration time = 0.5s) Anticipatory scheduler Anticipatory scheduler –After every read request servicing, wait a short duration to see if there is another read request from the same region is made. If yes, service it immediately.