Operating System Concepts and Techniques Lecture 7 Scheduling-3 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.

Slides:



Advertisements
Similar presentations
OPERATING SYSTEMS CS3530 Summer 2014 OPERATING SYSTEMS CS3530 Summer 2014 Input/Output System Chapter 9.
Advertisements

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 17 Scheduling III.
 Basic Concepts  Scheduling Criteria  Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 16 Scheduling II.
Operating Systems Chapter 6
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling Algorithms
Exercise (5).
Input/Output Management and Disk Scheduling
Chapter 3: CPU Scheduling
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
02/06/2008CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Scheduling in Batch Systems
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
6/25/2015Page 1 Process Scheduling B.Ramamurthy. 6/25/2015Page 2 Introduction An important aspect of multiprogramming is scheduling. The resources that.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
Chapter 5-CPU Scheduling
04/21/2004CSCI 315 Operating Systems Design1 Disk Scheduling.
A. Frank - P. Weisberg Operating Systems CPU Scheduling.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Modified from Silberschatz, Galvin and Gagne ©2009 Lecture 8 Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Basic Concepts Maximum CPU utilization.
CPU-Scheduling Whenever the CPU becomes idle, the operating system must select one of the processes in the ready queue to be executed. The short term scheduler.
Chapter 6: CPU Scheduling
Lecture 5: Uniprocessor Scheduling
Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo1 Disk & disk scheduling.
Discussion Week 10 TA: Kyle Dewey. Overview TA Evaluations Project #3 PE 5.1 PE 5.3 PE 11.8 (a,c,d) PE 10.1.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
CPU Scheduling Basic Concepts. Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: Process Scheduling.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Operating System Concepts and Techniques Lecture 6 Scheduling-2* M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
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.
Presentation-4 Group-A1 Professor Mohamed Khalil Anita Kanuganti Hemanth Rao.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
1 Module 5: Scheduling CPU Scheduling Scheduling Algorithms Reading: Chapter
Basic Concepts Maximum CPU utilization obtained with multiprogramming
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
1 Chapter 5: CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 6: CPU Scheduling
Process Scheduling B.Ramamurthy 12/5/2018.
Chapter 11 I/O Management and Disk Scheduling
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 4/11/2019.
Process Scheduling B.Ramamurthy 4/7/2019.
ITEC 202 Operating Systems
Presentation transcript:

Operating System Concepts and Techniques Lecture 7 Scheduling-3 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First ed., iUniverse Inc., To order: or

2 Computation of Turnaround Time (TT) Turnaround Time: is the time span starting from when a request is submitted and ending whenever the requested execution is completed We take Average TT to be the only performance measure of schedulers Three schedulers FCFS, SPN, and RR will be considered A system with the following three processes is examined ProcessArrival timeCPU burst P1P1 104 P2P2 113 p3p3 122

FCFS scheduler The following table shows how FCFS behaves 3 ProcessArrival timeCPU burstCompletion time Turnaround time P1P P2P P3P Single-programming and FIFO scheduling Average turnaround time = 17/3 = 5.66

SPN scheduler The following table shows how SPN behaves With SPN, whenever a scheduling decision has to be made, the decision is based on available information, not of future information, therefore at time 10 process 1 is picked but at time 14 process 3 is picked 4 Single-programming and SPN scheduling Average turnaround time = 16/3 = 5.33 ProcessArrival timeCPU burstCompletion time Turnaround time P1P P2P P3P

RR scheduler The following chart shows how SPN behaves When processes do not have any I/O operation and do not have to wait for any event, RR scheduler may perform worse than FCFS and SPN In cases of I/O, depending on average CPU wait ration, usually RR performs better 5 Multi-programming and RR scheduling Average turnaround time = 23/3 = Time Processes P 3 P 2 P 1 2.0

RR for Processes with I/O Here, we consider the same set of tasks but the average I/O ratio w=0.4, i.e., when there is only one process 40% of CPU time is wasted When there are two processes CPU wait fraction is w 2 =0.16 hence 84% of CPU time is useful, every process’s share is 42% When there are three processes CPU wait fraction is w 3 =0.064 hence approximately 94% of CPU time is useful, every process’s share is 31.3% 6 Multi-programming and RR scheduling with w=0.4 Average turnaround time = Time Processes P 3 P 2 P 1 2.0

Disk I/O Scheduling Disks have their own special schedulers Unit of work is reading/writing a sector Disks constantly receive requests from different processes Request arrivals is not uniform; therefore a pool for outstanding requests is needed Disk scheduler decides which request to pick from the pool when the disk head is finished its previous request 7

Disk properties The simplest kind of disk is a one surface with one moving head It is composed of many concentric tracks with every track having the same number of sectors, see below 8 Track Sector Moving head

Reading/writing a sector Reading/Writing a sector comprises Seek time: the time length for the read/write head to move from current position to the desired track Rotational delay: is the length of time for the beginning of sector to reach the read/write head, after the head has settled on the desired track  Average rotational delay is considered to be half the time of one complete disk rotation Transfer time: The time to transfer one sector of data depends on the rotation speed, track capacity, and sector size, This is equal to: 9

Schedulers Rotational delay and transfer time is fixed The performance of a disk scheduler thus depends on the order in which outstanding requests are answered A track trace is set of requests in the order of arrival We study, FIFO, LIFO, SSTF, Scan, C- Scan schedulers 10

FIFO 11 From To Seek length Total = 494 Track trace 34, 57, 28, 65, 190, 120, 163, 163, 180, 46  Let’s assume head’s current position is on track 50  The shortest seek length for is zero  The longest seek length is n-1  With FIFO there is no risk of starvation  New request may not be served before existing ones

LIFO 12 From To Seek length Total = 494 Track trace 34, 57, 28, 65, 190, 120, 163, 163, 180, 46  Let’s assume head’s current position is on track 50  The shortest seek length for is zero  The longest seek length is n-1  An existing request may never get the chance to be executed because new requests keep coming, dtarvation  With LIFO, arrival of new requests causes the serving of previous ones to delay

Shortest Service Time First 13 Track trace 34, 57, 28, 65, 190, 120, 163, 163, 180, 46  Let’s assume head’s current position is on track 50  The shortest seek length for is zero  The longest seek length is n-1  SSTF may cause starvation for some requests  With SSTF, arrival of new requests may cause the serving of previous ones to delay From To Seek length Total = 222

Scan 14 Track trace 34, 57, 28, 65, 190, 120, 163, 163, 180, 46  Let’s assume head’s current position is on track 50  The shortest seek length for is zero  The longest seek length is n-1.  Scan is considered starvation-free  With SSTF, arrival of new requests may cause the serving of previous ones to delay From To Seek length Total = 302

C-Scan 15 Track trace 34, 57, 28, 65, 190, 120, 163, 163, 180, 46  Let’s assume head’s current position is on track 50  The shortest seek length for is zero  The longest seek length is n-1.  Scan is considered starvation-free  With SSTF, arrival of new requests may cause the serving of previous ones to delay From To Seek length Total = 320

Summary A scheduling strategy is usually designed to attain a defined objective, although multi-objective strategies are also possible Average turnaround time (ATT) may be used to estimate the expected time length in which a request is completed after being submitted to the system; this could be a good measure of performance Based on ATT different scheduling algorithms were investigated Besides, in this chapter, I/O scheduling was studied and different schedulers such as FIFO, LIFO, SSTF, Scan, and C-Scan were introduced 16

17 Find out How ATT is computed for nonpreemptive schedulers such as FIFO and SJN where w  0 How FIFO, SJN, and RR behave with respect to throughput How I/O schedulers work for two-surface disks How I/O schedulers work for disk packs, i.e., disks with multiple plates each having two surfaces How I/O schedulers work for multiples Read/write heads per surface What the role of cylinders are with respect to I/O schedulers

18 Any questions?