Chapter 11 I/O Management and Disk Scheduling

Slides:



Advertisements
Similar presentations
I/O Management and Disk Scheduling
Advertisements

I/O Management and Disk Scheduling
Overview of Mass Storage Structure
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
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
I/O Management and Disk Scheduling
Chapter 11 I/O Management and Disk Scheduling
Disk Scheduling Based on the slides supporting the text 1.
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.
Disks.
Device Management.
1 Disk Scheduling Chapter 14 Based on the slides supporting the text.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Disk and I/O Management
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.
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.
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.
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.
I/O Management and Disk Scheduling Chapter 11. Categories of I/O Devices Human readable Used to communicate with the user  Printers, Display terminals,
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.
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.
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.
M ASS S TORAGE S TRUCTURES Lecture: Operating System Concepts Lecturer: Pooja Sharma Computer Science Department, Punjabi University, Patiala.
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,
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 11: File System Implementation.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems DISK I/0.
Chapter 10: Mass-Storage Systems
Principles of Operating Systems Lecture 18
Operating System (013022) Dr. H. Iwidat
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
OPERATING SYSTEMS CS 3502 Fall 2017
Chapter 12: Mass-Storage Structure
Operating System I/O System Monday, August 11, 2008.
Disk Scheduling Algorithms
Mass-Storage Structure
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
Lecture 45 Syed Mansoor Sarwar
Chapter 14 Based on the slides supporting the text
Operating Systems (CS 340 D)
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.
Chapter 37 Hard Disk Drives
Overview Continuation from Monday (File system implementation)
Persistence: hard disk drive
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.
CSE451 File System Introduction and Disk Drivers Autumn 2002
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:

Chapter 11 I/O Management and Disk Scheduling These slides are intended to help a teacher develop a presentation. This PowerPoint covers the entire chapter and includes too many slides for a single delivery. Professors are encouraged to adapt this presentation in ways which are best suited for their students and environment.

Differences in I/O Devices Devices differ in a number of areas Data Rate Application Complexity of Control Unit of Transfer Error Conditions Each of these are covered in subsequent slides This diversity makes a uniform and consistent approach to I/O, both from the point of view of the operating system and from the point of view of user processes, difficult to achieve.

Data Rate There may be differences of several orders of magnitude between the data transfer rates.

Efficiency Most I/O devices extremely slow compared to main memory Use of multiprogramming allows for some processes to be waiting on I/O while another process executes I/O cannot keep up with processor speed Efficiency is important because I/O operations often form a bottleneck in a computing system. One way to tackle this problem is multiprogramming, which, as we have seen, allows some processes to be waiting on I/O operations while another process is executing. However, even with the vast size of main memory in today’s machines, often I/O is not keeping up with the activities of the processor. Swapping is used to bring in additional ready processes to keep the processor busy, but this in itself is an I/O operation. Thus, a major effort in I/O design has been schemes for improving the efficiency of the I/O. The area that has received the most attention, because of its importance, is disk I/O.

Disk Performance Parameters The actual details of disk I/O operation depend on many things The actual details of disk I/O operation depend on the computer system, the operating system, and the nature of the I/O channel and disk controller hardware. A general timing diagram of disk I/O transfer is shown in Figure 11.6.

Positioning the Read/Write Heads When the disk drive is operating, the disk is rotating at constant speed. Track selection involves moving the head in a movable-head system or electronically selecting one head on a fixed-head system. When the disk drive is operating, the disk is rotating at constant speed. To read or write, the head must be positioned at the desired track and at the beginning of the desired sector on that track. Track selection involves moving the head in a movable-head system or electronically selecting one head on a fixed-head system.

Disk Performance Parameters Access Time is the sum of: Seek time: The time it takes to position the head at the desired track Rotational delay or rotational latency: The time its takes for the beginning of the sector to reach the head The average rotational delay is half of the 1 rotate time Transfer Time is the time taken to transfer the data. Access Time is the sum of Seek Time is the time it takes to position the head at the track. Rotational delay is the time it takes for the beginning of the sector to reach the head Once the head is in position, the read or write operation is then performed as the sector moves under the head; this is the data transfer portion of the operation; the time required for the transfer is the transfer time.

Disk Performance Parameters Access Time is the sum of Seek Time is the time it takes to position the head at the track. Rotational delay is the time it takes for the beginning of the sector to reach the head Once the head is in position, the read or write operation is then performed as the sector moves under the head; this is the data transfer portion of the operation; the time required for the transfer is the transfer time.

Disk Performance Parameters Assume that we have a disk with : Average seek time: 10 ms Rotation rate: 3600 RPM Transfer rate: 2 MB/second Sector size: 512 bytes Controller overhead: 5 ms What is the average transfer time of a sector? 5 + 10 + 8.3 + 0.2 = 23.5 Access Time is the sum of Seek Time is the time it takes to position the head at the track. Rotational delay is the time it takes for the beginning of the sector to reach the head Once the head is in position, the read or write operation is then performed as the sector moves under the head; this is the data transfer portion of the operation; the time required for the transfer is the transfer time.

Disk Scheduling Policies FIFO LIFO SSTF SCAN C-SCAN

Disk Scheduling Policies To compare various schemes, consider a disk head is initially located at track 100. assume a disk with 200 tracks and that the disk request queue has random requests in it. Assume that moving the head between two consecutive tracks takes 1 ms. The requested tracks, in the order received by the disk scheduler, are 55, 58, 39, 18, 90, 160, 150, 38, 184.

First-in, first-out (FIFO) Process request sequentially Fair to all processes Approaches random scheduling in performance if there are many processes 55, 58, 39, 18, 90, 160, 150, 38, 184 Avg Seek time= (45+3+19+21+72+70+10+112+146)/9 = 55.3 ms Movie icon jumps to animation at http://gaia.ecs.csus.edu/%7ezhangd/oscal/DiskApplet.html The simplest form of scheduling is first-in-first-out (FIFO) scheduling, which processes items from the queue in sequential order. This strategy has the advantage of being fair, because every request is honored and the requests are honored in the order received. This figure illustrates the disk arm movement with FIFO. This graph is generated directly from the data in Table 11.2a. As can be seen, the disk accesses are in the same order as the requests were originally received. With FIFO, if there are only a few processes that require access and if many of the requests are to clustered file sectors, then we can hope for good performance. But, this technique will often approximate random scheduling in performance, if there are many processes competing for the disk.

Last-in, first-out Good for transaction processing systems The device is given to the most recent user so there should be little arm movement Possibility of starvation since a job may never regain the head of the line In transaction processing systems, giving the device to the most recent user should result in little or no arm movement for moving through a sequential file.

Shortest Service Time First (SSTF) Select the disk I/O request that requires the least movement of the disk arm from its current position Always choose the minimum seek time 55, 58, 39, 18, 90, 160, 150, 38, 184 Avg Seek time=(10+32+3+16+1+20+132+10+24)/9 = 27.5 ms Select the disk I/O request that requires the least movement of the disk arm from its current position. Thus, we always choose to incur the minimum seek time. Always choosing the minimum seek time does not guarantee that the average seek time over a number of arm movements will be minimum. However, this should provide better performance than FIFO. Because the arm can move in two directions, a random tie-breaking algorithm may be used to resolve cases of equal distances.

SCAN (Elevator) Arm moves in one direction only, satisfying all outstanding requests until it reaches the last track in that direction then the direction is reversed 55, 58, 39, 18, 90, 160, 150, 38, 184 Avg Seek time=(50+10+24+94+32+3+16+1+20)/9 = 27.7 ms With SCAN, the arm is required to move in one direction only, satisfying all outstanding requests en route, until it reaches the last track in that direction or until there are no more requests in that direction. The service direction is then reversed and the scan proceeds in the opposite direction, again picking up all requests in order. This latter refinement is sometimes referred to as the LOOK policy. The SCAN policy favors jobs whose requests are for tracks nearest to both innermost and outermost tracks and favors the latest-arriving jobs.

C-SCAN Restricts scanning to one direction only 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 55, 58, 39, 18, 90, 160, 150, 38, 184 Avg Seek time=(50+10+24+166+20+1+16+3+32)/9 = 35.8 ms The C-SCAN (circular SCAN) policy restricts scanning to one direction only. Thus, 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. This reduces the maximum delay experienced by new requests.

Performance Compared Comparison of Disk Scheduling Algorithms T

Linux Elevator Scheduler Maintains a single queue for disk read and write requests Keeps list of requests sorted by block number Drive moves in a single direction to satisfy each request The elevator scheduler maintains a single queue for disk read and write requests and performs both sorting and merging functions on the queue. The elevator scheduler keeps the list of requests sorted by block number. As the disk requests are handled, the drive moves in a single direction, satisfying each request as it is encountered.