1 IO Management and Disk Scheduling Chapter 11. 2 Categories of I/O Devices n Human readable u used to communicate with the user u video display terminals.

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.
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
Chapter 11 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.
Chapter 11 I/O Management and Disk Scheduling
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.
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.
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.
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 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.
Operating System 11 I/O MANAGEMENT AND DISK SCHEDULING
RAID Ref: Stallings. Introduction The rate in improvement in secondary storage performance has been considerably less than the rate for processors and.
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.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
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 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.
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.
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.
Page 1 2P13 Week 10. Page 2 Page 3 Static table-driven approaches performs a static analysis of feasible schedules of dispatching result is a schedule.
OPERATING SYSTEMS IO SYSTEMS. Categories of I/O Devices Human readable –Used to communicate with the user –Printers –Video display terminals Display Keyboard.
Chapter 11 I/O Management and Disk Scheduling Eighth Edition By William Stallings Operating Systems: Internals and Design Principles.
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.
Chapter 14: Mass-Storage Systems Disk Structure. Disk Scheduling. RAID.
Fall 2000M.B. Ibáñez Lecture 26 I/O Systems II. Fall 2000M.B. Ibáñez Application I/O Interface I/O system calls encapsulate device behaviors in generic.
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.
Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
INPUT OUTPUT MANAGEMENT Prepared By: Dr. Vipul Vekariya.
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
RAID, Programmed I/O, Interrupt Driven I/O, DMA, Operating System
I/O System Chapter 5 Designed by .VAS.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Operating System I/O System Monday, August 11, 2008.
Chapter 14 Based on the slides supporting the text
Overview Continuation from Monday (File system implementation)
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.
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
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

1 IO Management and Disk Scheduling Chapter 11

2 Categories of I/O Devices n Human readable u used to communicate with the user u video display terminals u keyboard u mouse u printer

3 Categories of I/O Devices n Machine readable u used to communicate with electronic equipment u disk drives u tape drives u controllers u Sensors u actuators u USB keys

4 Categories of I/O Devices n Communication u used to communicate with remote devices u digital line drivers u modems

5 Differences in I/O Devices n Data Transfer Rate: may be different of several orders of magnitude between the data transfer rates n Application u disk used to store files must have file- management software u disk used to store virtual memory pages needs special hardware to support it u terminal used by system administrator may have a higher priority

6 Differences in I/O Devices n Complexity of control n Unit of transfer u data may be transferred as a stream of bytes for a terminal or in larger blocks for a disk n Data representation u encoding schemes n Error conditions u devices respond to errors differently

7 I/O Device Data Rates

8 Techniques for Performing I/O n Programmed I/O u process is busy-waiting for the operation to complete n Interrupt-driven I/O u I/O command is issued u processor continues executing instructions u I/O module sends an interrupt when done

9 Techniques for Performing I/O n Direct Memory Access (DMA) u DMA module controls exchange of data between main memory and the I/O device u processor interrupted only after entire block has been transferred

10 Evolution of the I/O Function n Processor directly controls a peripheral device n Controller or I/O module is added u Processor uses programmed I/O without interrupts u Processor does not need to handle details of external devices

11 Evolution of the I/O Function n Controller or I/O module with interrupts u Processor does not spend time waiting for an I/O operation to be performed n Direct Memory Access u Blocks of data are moved into memory without involving the processor u Processor involved at beginning and end only

12 Evolution of the I/O Function n I/O module is a separate processor n I/O processor u I/O module has its own local memory u It is a computer in its own right

13 Direct Memory Address n Processor delegates I/O operation to the DMA module n DMA module transfers data directly to or from memory n When transfer is complete, DMA module sends an interrupt signal to the processor

14 DMA

15 DMA Configurations

16 DMA Configurations

17 Operating System Design Objectives – Non-functional Quality Attributes n Efficiency is an important issue u I/O cannot keep up with processor speed u Use of multiprogramming u Swapping is used to bring in additional Ready processes which is an I/O operation n Generality is an important issue u Desirable to handle all I/O devices in a uniform manner u Hide most of the details of device I/O in lower-level routines so that processes and upper levels see devices in general terms such as Read, Write, Open, and Close

18 A Model of I/O Organization Scheduling & Control Device I/O Scheduling & Control Scheduling & Control Local peripheral deviceCommunications portFile System Device I/O Device I/O Hardware User Processes User Processes User Processes User Processes User Processes User Processes Logical I/O Comm. Architecture Directory Management File System Physical Organization General access methods

19 I/O Buffering n Reasons for buffering u Processes must wait for I/O to complete before proceeding u Certain pages must remain in main memory during I/O

20 I/O Buffering n Block-oriented u information is stored in fixed sized blocks u transfers are made a block at a time u used for disks and tapes n Stream-oriented u transfer information as a stream of bytes u used for terminals, printers, communication ports, mouse, and most other devices that are not secondary storage

21 No Buffering Operating SystemUser Process No buffering I/O Device In

22 Single Buffer n Operating system assigns a buffer in main memory for an I/O request n Block-oriented u input transfers made to buffer u block moved to user space when needed u another block is moved into the buffer F read ahead Operating SystemUser Process Single buffering I/O Device InMove

23 Single Buffer n Block-oriented u user process can process one block of data while next block is read in u swapping can occur since input is taking place in system memory, not user memory u operating system keeps track of assignment of system buffers to user processes u output is accomplished by the user process writing a block to the buffer and later actually written out

24 Single Buffer n Stream-oriented u used a line at time u user input from a terminal is one line at a time with carriage return signaling the end of the line u output to the terminal is one line at a time

25 Double Buffer n Use two system buffers instead of one n A process can transfer data to or from one buffer while the operating system empties or fills the other buffer I/O Device In Move Operating SystemUser Process Double buffering

26 Circular Buffer n More than two buffers are used n Each individual buffer is one unit in a circular buffer n Used when I/O operation must keep up with process I/O Device InMove Operating SystemUser Process Circular buffering..

27 Disk Performance Parameters n To read or write, the disk head must be positioned at the desired track and at the beginning of the desired sector n Seek time u time it takes to position the head at the desired track n Rotational delay or rotational latency u time its takes until desired sector is rotated to line up with the head

28 Disk Performance Parameters n Access time u sum of seek time and rotational delay u the time it takes to get in position to read or write n Data transfer time u Data transfer occurs as the sector moves under the head u Data transfer for an entire file is faster when the file is stored in the same cylinder and in adjacent sectors

29 Disk Scheduling Policies n Seek time is the reason for differences in performance n Why disk scheduling? u For a single disk there will be a number of I/O requests u If requests are selected randomly, we will get the worst possible performance

30 Disk Scheduling Policies n First-in, first-out (FIFO) u process request sequentially u fair to all processes u approaches random scheduling in performance if there are many processes

31 Disk Scheduling Policies n Priority u goal is not to optimize disk use but to meet other objectives u short batch jobs may have higher priority u provide good interactive response time

32 Disk Scheduling Policies n Last-in, first-out u good for transaction processing systems F the device is given to the most recent user so there should be little arm movement u possibility of starvation since a job may never regain the head of the line

33 Disk Scheduling Policies n Shortest Service Time First u select the disk I/O request that requires the least movement of the disk arm from its current position u always choose the minimum Seek time

34 Disk Scheduling Policies n SCAN u arm moves in one direction only, satisfying all outstanding requests until it reaches the last track in that direction u direction is reversed

35 Disk Scheduling Policies n C-SCAN u restricts scanning to one direction only u when the last track has been visited in one direction, the arm is returned to the opposite end of the disk and the scan begins again

36 Disk Scheduling Policies n N-step-SCAN u segments the disk request queue into subqueues of length N u subqueues are process one at a time, using SCAN u new requests added to other queue when queue is processed n FSCAN u two queues u one queue is empty for new request

37 Disk Scheduling Algorithms

38 RAID – Redundant Array of Independent Disks n Logical view: Set of physical disk drives viewed by the operating system as a single logical drive n Physical view: Data are distributed across the physical drives of an array n Redundant disk capacity is used to store parity or redundant information n Why RAID? u Reliability u Performance

39 RAID 0 (non-redundant) strip 0 strip 4 strip 8 strip 12 strip 1 strip 5 strip 9 strip 13 strip 2 strip 6 strip 10 strip 14 strip 3 strip 7 strip 11 strip 15

40 Data Mapping for RAID Level 0 Array strip 0 strip 4 strip 8 strip 12 strip 1 strip 5 strip 9 strip 13 strip 2 strip 6 strip 10 strip 14 strip 3 strip 7 strip 11 strip 15 Physical Disk 0 Physical Disk 1 Physical Disk 2 Physical Disk 3 strip 0 strip 1 strip 2 strip 3 strip 4 strip 15 strip 14 strip 13 strip 12 strip11 strip 10 strip 9 strip 8 strip 7 strip 6 strip 5 Array Management Software A single logical disk drive A Set of physical disk drives

41 RAID 0 (nonredundant)

42 RAID 1 (mirrored)

43 RAID 2 (redundancy through Hamming code)

44 RAID 3 (bit-interleaved parity)

45 RAID 4 (block-level parity)

46 RAID 5 (block-level distributed parity)

47 RAID 6 (dual redundancy)

48 Disk Cache n Buffer in main memory for disk sectors n Contains a copy of some of the sectors on the disk

49 Least Recently Used n The block that has been in the cache the longest with no reference to it is replaced n The cache consists of a stack of blocks n Most recently referenced block is on the top of the stack n When a block is referenced or brought into the cache, it is placed on the top of the stack

50 Least Recently Used n The block on the bottom of the stack is removed when a new block is brought in n Blocks don’t actually move around in main memory n A stack of pointers is used

51 Least Frequently Used n The block that has experienced the fewest references is replaced n A counter is associated with each block n Counter is incremented each time block accessed

52 Least Frequently Used n Block with smallest count is selected for replacement n Some blocks may be referenced many times in a short period of time and the reference count is misleading

53 Disk Cache Performance

54 Disk Cache Performance