Process Scheduling Chapter 4.

Slides:



Advertisements
Similar presentations
CH 5. CPU Scheduling Basic Concepts F CPU Scheduling  context switching u CPU switching for another process u saving old PCB and loading.
Advertisements

UNIT - 7 SCHEDULING.
Chapter 7 Scheduling Copyright © 2008.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Ceng Operating Systems Chapter 2.2 : Process Scheduling Process concept  Process scheduling Interprocess communication Deadlocks Threads.
Chapter 3: CPU Scheduling
Project 2 – solution code
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.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5-CPU Scheduling
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
CPU Scheduling Basic Concepts Scheduling Criteria
A. Frank - P. Weisberg Operating Systems CPU Scheduling.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Main Job: Assign processes to be executed by the processor(s) and processes to be loaded in main.
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.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
OPERATING SYSTEMS CPU SCHEDULING.  Introduction to CPU scheduling Introduction to CPU scheduling  Dispatcher Dispatcher  Terms used in CPU scheduling.
Chapter 6 CPU SCHEDULING.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
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.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
1 Our focus  scheduling a single CPU among all the processes in the system  Key Criteria: Maximize CPU utilization Maximize throughput Minimize waiting.
Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times.
CS Spring 2011 CS 414 – Multimedia Systems Design Lecture 31 – Multimedia OS (Part 1) Klara Nahrstedt Spring 2011.
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: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
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.
Cpr E 308 Spring 2005 Process Scheduling Basic Question: Which process goes next? Personal Computers –Few processes, interactive, low response time Batch.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Assign processes to be executed by the processor or processors: –Response time –Throughput –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.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 31 – Process Management (Part 1) Klara Nahrstedt Spring 2009.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
CS333 Intro to Operating Systems Jonathan Walpole.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 32 – Multimedia OS Klara Nahrstedt Spring 2010.
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
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 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.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
CPU SCHEDULING.
Chapter 5a: CPU Scheduling
Uniprocessor Scheduling
Chapter 8 – Processor Scheduling
Chapter 2.2 : Process Scheduling
Process Scheduling B.Ramamurthy 11/18/2018.
Chapter 6: CPU Scheduling
Chapter5: CPU Scheduling
CPU SCHEDULING.
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 4/11/2019.
Process Scheduling B.Ramamurthy 4/7/2019.
Chapter 6: CPU Scheduling
Presentation transcript:

Process Scheduling Chapter 4

A schematic of scheduling

Scheduling-related Concepts and Terms

Kinds of Scheduling Non-preemptive scheduling: A process runs to completion when scheduled Preemptive scheduling: A process may be preempted by the kernel, and another process may be scheduled. Hence a set of processes are processed in an overlapped manner.

Processes for scheduling

Non-preemptive scheduling Performance criteria: Throughput Turnaround times of processes Weighted turnaround Change the order in which processes are serviced Non-preemptive scheduling policies: - First come first served (FCFS) - Shortest request first Q: Which policy will provide better throughput under what conditions?

Scheduling using FCFS and SRN policies

Performance of FCFS and SRN scheduling

Preemptive scheduling policies Performance criteria: Throughput Response time to a subrequest Scheduling policies Round-robin with time slicing (RR) Least completed next (LCN) Shortest time to go (STG): shortest remaining time Highest response ratio (HRN): defined later

Round-robin with time slicing (RR)

Least completed next (LCN)

Shortest time to go (STG)

Scheduling using preemptive scheduling policies

Operation of preemptive scheduling policies

Performance of preemptive scheduling policies

Variation of average response time with time slice

Highest response ratio next (HRN) Two ways of defining response ratio of a process Response ratio = Time in the system / service time recd Response ratio = (Time in the system + execution time)/ service time received We use the first definition in the next slide HRN eliminates the drawbacks of LCN and STG policies. Q: How?

Performance of HRN scheduling policy

Long, medium and short-term scheduling

Event handling and scheduling

Long, medium and short-term scheduling in a time sharing system

Mechanism and policy modules of process scheduler

Simple priority-based scheduling

Priority-based scheduling

Priority-based scheduling What should the kernel do if there aren’t any ready processes? Schedule a dummy process that does nothing Put the processor to sleep (conserves power!)

Round-robin scheduling

Ready lists in a time sharing system

Practical scheduling policies Provide a good balance of response time and overhead Vary the time slice! Vary the priority Provide fair service to processes (Q: How defined?) In round-robin, all process receive approx similar service. What if one application has 5 processes, while another application has only 1 process?

Multilevel scheduling

Ready lists in a multilevel scheduler

Multi-level adaptive scheduling Vary the priority of a process depending on its recent behaviour If the process uses up its time slice, it must be (more) CPU bound than assumed, so reduce its priority If a process is starved of CPU attention for some time, increase its priority

Example of multi-level adaptive scheduling

Fair share scheduling

Scheduling in Unix Processes are assigned priorities that are integer values A larger value implies a lower priority Priority of a process is varied based on its CPU usage So as not to have an LCN-like effect (starvation!), the effect of CPU time used is decays with time, hence only recent CPU usage affects priority of a process Priority of a process = Base priority + nice value + f(CPU time used by the process

Operation of a Unix-like scheduling policy when process perform I/O

Fair-share scheduling using a Unix-like policy Groups of processes are defined for ensuring fair share of CPU time Priority of a process depends on the CPU time used by all processes its group Priority of a process = Base priority + nice value + f(CPU time used by the process) + f(CPU time used by all processes in the same group)

Operation of a fair share scheduling

Real time scheduling Perform scheduling such that each process can meet its deadline Procedure: Consider precedences between processes, i.e. which process should complete before which other process Find the deadline of each application Use a scheduling policy which ensures that deadlines are met (in a soft real time system, it is adequate to try to meet the deadlines, and succeed most of the time)

Real time scheduling

Process precedence graph (PPG) for a simple real time system

Deadlines for processes of previous slide Total execution time = 25 seconds If the deadline for the application as a whole is 35 seconds process P6 has a deadline of 35 seconds processes P4 and P5 have deadlines of 30 seconds Q: What are the deadlines of other processes?

Feasible schedule An application has a feasible schedule if there exists at least one sequence in which its processes can be scheduled so that deadlines of all processes are met Justify the following statement: “If a feasible schedule exists for an application, then earliest deadline first (EDF) scheduling can meet all deadlines.”

Performance of Earliest Deadline First Scheduling

Rate Monotonic Scheduling (RMS) Priority of a process is inversely proportional to its periodicity Priority-based scheduling is now used Q: Does RMS guarantee that deadlines will be met if an application has a feasible schedule?

Rate Monotonic Scheduling (RMS) Consider three processes: P1 P2 P3 Time period 10 15 30 Execution time 3 5 9 What are their priorities? Does a feasible schedule exist? Consider summation of (execution time/time period) Feasible schedule exists if summation is < 1. Will RMS find a feasible schedule?

Summary of performance analysis