Chapter 7 Scheduling Chien-Chung Shen CIS, UD

Slides:



Advertisements
Similar presentations
Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) Throughput – # of processes that complete their execution per.
Advertisements

OS, , Part II CPU Scheduling Department of Computer Engineering, PSUWannarat Suntiamorntut.
CPU Scheduling Questions answered in this lecture: What is scheduling vs. allocation? What is preemptive vs. non-preemptive scheduling? What are FCFS,
CPU Scheduling CPU Scheduler Performance metrics for CPU scheduling
 Basic Concepts  Scheduling Criteria  Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Operating Systems Chapter 6
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.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (2) Process Management 10/03/2008 Yang Song (Prepared by Yang Song and.
Chapter 5-CPU Scheduling
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
Job scheduling Queue discipline.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
CPU Scheduling Chapter 6 Chapter 6.
Chapter 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
Chapter 6 CPU SCHEDULING.
Number of processes OS switches context from A to B main use fork, and the child process call execvp() Can compiler do something bad by adding privileged.
CS252: Systems Programming Ninghui Li Based on Slides by Prof. Gustavo Rodriguez-Rivera and Chapters 7,8 of OSTEP Topic 20: Processes Scheduling.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Round Robin Scheduling A preemptive scheduling designed for Time Sharing Systems The Ready Queue is treated as a circular queue A small execution.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
1 Our focus  scheduling a single CPU among all the processes in the system  Key Criteria: Maximize CPU utilization Maximize throughput Minimize waiting.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
CPU Scheduling Basic Concepts. Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor.
Chapter 5 CPU Scheduling Bernard Chen Spring 2007.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 7: CPU Scheduling Chapter 5.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
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.
ITFN 2601 Introduction to Operating Systems Lecture 4 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.
Processor Scheduling Hank Levy. 22/4/2016 Goals for Multiprogramming In a multiprogramming system, we try to increase utilization and thruput by overlapping.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
1 Uniprocessor Scheduling Chapter 3. 2 Alternating Sequence of CPU And I/O Bursts.
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.
Lecture 5 Scheduling. Today CPSC Tyson Kendon Updates Assignment 1 Assignment 2 Concept Review Scheduling Processes Concepts Algorithms.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Chapter 7 Scheduling Chien-Chung Shen CIS/UD
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.
CPU Scheduling Andy Wang Operating Systems COP 4610 / CGS 5765.
Scheduling Policies.
CPU SCHEDULING.
April 6, 2001 Gary Kimura Lecture #6 April 6, 2001
CPU Scheduling.
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Andy Wang Operating Systems COP 4610 / CGS 5765
Operating System Concepts
CPU SCHEDULING.
Process Scheduling Decide which process should run and for how long
Processor Scheduling Hank Levy 1.
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
Scheduling 21 May 2019.
Don Porter Portions courtesy Emmett Witchel
CPU Scheduling: Basic Concepts
Presentation transcript:

Chapter 7 Scheduling Chien-Chung Shen CIS, UD

Scheduling Low-level mechanisms - context switching High-level policies – scheduling policies Appears in many disciplines – assembly lines for efficiency How to develop a framework for studying scheduling policy? –assumptions of workload –metrics of performance –approaches

Workload Assumptions Workload – {processes} running in the system –critical to building policies - the more you know, the more fine-tuned your policy can be –unrealistic, initially, but will be relaxed later Each job runs for the same amount of time All jobs arrive at the same time All jobs only use CPU (i.e., they perform no I/O) The run-time of each job is known – scheduler know everything!

Scheduling Metrics To compare different scheduling policies Metrics – used to measure something Turnaround time - the time at which the job completes minus the time at which the job arrived in the system –a performance metric Fairness metric vs. performance metrics –Jain’s Fairness Index

First In First Out (FIFO) First come, first served (FCFS) Each job runs 10 sec. Average turnaround time = ? = ( )/3 = 20

First In First Out (FIFO) What kind of workload could you construct to make FIFO perform poorly? Average turnaround time = ? = ( )/3 = 110 Convoy effect (supermarket checkout)

Shortest Job First (SJF) Average turnaround time = ? = ( )/3 = 50 Assuming all jobs arrive at the same time, SJF is optimal

Shortest Time-to-Completion First SJF with A arrives at 0, and B, C at 10 How would you do better? Preemption or Preemptive SJF (also optimal with assumption that jobs arrive at any time)

Metric: Response Time Interactive applications Response time = time from when the job arrives in a system to the first time it is scheduled vs. turnaround time

Round Robin Instead of running jobs to completion, RR runs a job for a time slice (scheduling quantum) and switches to the next job in the ready queue; repeatedly does so until jobs are finished Time slicing – length of time slice = multiple of timer-interrupt period –RR response time = 1 –SJF response time = 5 Length of time slice on response time ???

Round Robin Amortization –used in systems when there is a fixed cost to some operation –By incurring that cost less often, the total cost to the system is reduced Length of time slice on response time ??? –The shorter the time slice, the shorter (better) the response –Too short, cost of context switching dominates –Length of time slice is a tradeoff - long enough to amortize the cost of switching without making it so long that the system is no longer responsive any policy (such as RR) that is fair (evenly divides CPU among active processes on a small time scale), will perform poorly on metrics such as turnaround time

Incorporating I/O Process is blocked waiting for I/O completion When I/I completes, an interrupt is raised, and OS runs and moves the process that issued the I/O from blocked state back to the ready state Poor use of CPU Overlap CPU & I/O –higher CPU utilization Interactive jobs get run frequently; while they are performing I/O, other CPU-intensive jobs run