MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)

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

Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 6a: CPU Scheduling.
CPU SCHEDULING RONG ZHENG. OVERVIEW Why scheduling? Non-preemptive vs Preemptive policies FCFS, SJF, Round robin, multilevel queues with feedback, guaranteed.
Operating Systems Chapter 6
Operating Systems CPU Scheduling. Agenda for Today What is Scheduler and its types Short-term scheduler Dispatcher Reasons for invoking scheduler Optimization.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Processes and Their Scheduling.
Chapter 3: CPU Scheduling
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
Operating Systems 1 K. Salah Module 2.1: CPU Scheduling Scheduling Types Scheduling Criteria Scheduling Algorithms Performance Evaluation.
CPU Scheduling CS 416: Operating Systems Design, Spring 2001
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Scheduling in Batch Systems
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.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
Chapter 5-CPU Scheduling
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 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
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.
More Scheduling cs550 Operating Systems David Monismith.
Fair Resource Access & Allocation  OS Scheduling
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.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
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.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
CS Spring 2011 CS 414 – Multimedia Systems Design Lecture 31 – Multimedia OS (Part 1) Klara Nahrstedt Spring 2011.
Process A program in execution. But, What does it mean to be “in execution”?
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 7: CPU Scheduling Chapter 5.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
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.
1 Real-Time Scheduling. 2Today Operating System task scheduling –Traditional (non-real-time) scheduling –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.
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.
Introduction to Operating System Created by : Zahid Javed CPU Scheduling Fifth Lecture.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
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.
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Process Scheduling B.Ramamurthy 11/18/2018.
CPU Scheduling Basic Concepts Scheduling Criteria
Chapter 6: CPU Scheduling
Andy Wang Operating Systems COP 4610 / CGS 5765
Operating System Concepts
Process Scheduling Decide which process should run and for how long
Process Scheduling B.Ramamurthy 2/23/2019.
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
Chapter 6: CPU Scheduling
CPU Scheduling.
Chapter 5: CPU Scheduling
Presentation transcript:

MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)

Announcements

CPU Scheduling Maintain many programs in memory Determine how to best schedule them Requires information about the processes and an understanding of the system goals Switch among processes rapidly so each user perceives direct ownership of system

Process State New – being created Terminated – finishing execution Running – executing on the CPU Waiting – blocking on an event Ready – waiting for the CPU

Process Control Block Represents a process in the OS –process state –program counter –CPU registers –scheduling information –virtual memory information (e.g., page tables) –I/O status information

Resource Queues Sem Queue head tail Ready Queue head tail PCB 6 State Registers … Disk Queue head tail PCB 5 State Registers … PCB 4 State Registers … PCB 3 State Registers … PCB 2 State Registers … PCB 1 State Registers …

CPU Scheduler When CPU becomes idle, select next process from the ready queue CPU may become idle when: –allotted time slice expires –interrupt occurs (timer, I/O, user input) –application makes an I/O request –application terminates

Evaluation Criteria Throughput: processes completed per unit time Turnaround: from submission to termination Wait: time waiting in the ready queue Response: from user request to system response Utilization: how busy the CPU is over time Want predictable system behavior

Scheduling Algorithms FCFS Shortest Job First Priority scheduling Round-robin Multi-level queue Rate monotonic Earliest deadline first

FCFS Process requests in order of arrival –non-preemptive algorithm –fairness (human vs. system perspective) –convoy effect

Shortest-Job-First Schedule process with smallest burst –difficult to know next CPU burst –use weighted average of past performance Gives min wait time for processes –if preemptive, may lead to starvation

Priority Associate priority with each process Schedule process with highest priority –equal priority resolved via FCFS –if priority is a function of time, gives SJF Combat CPU starvation using aging –increase priority of long-waiting processes

Round Robin Schedule process after a time quantum –circulate around queue, give each process single time quantum to execute –results in lots of context switches Selection of time quantum –short quantum results in longer waits –infinite quantum results in FCFS –should be large relative to context switch time

Take Home Exercise Assume workload shown on the right Compare FCFS, SJF, and RR (quantum=10) –compare along each evaluation criteria ProcessArrivalCPU Burst P1110 P2229 P333 P447 P5512

Multimedia Processes Exhibit continuous, periodic behavior Execute along with other processes Have perceptual constraints (QoS)

Scheduling Determine sharing of a resource such that all admitted tasks meet their deadlines Balance need to meet deadlines with maximizing throughput and utilization

Admissibility Test If test succeeds, the task can be added, and all tasks will still meet deadlines –called a feasible schedule Process utilization (U) <1 if deadlines considered

Rate Monotonic Scheduling Static, fixed priority-based, periodic tasks –C i is execution time of task i –T i is request period of task i Determines if a set of periodic tasks can be scheduled or not (feasible schedule) –no other fixed priority scheme can schedule a set of tasks which can’t be scheduled by RM Liu, C.L. and J.W. Layland. Journal of the ACM, 20(1): 46-61, 1973

Model Assumptions All requests to process tasks are periodic Each task must finish before next request Each request is independent Execution time for each task is constant Non-periodic tasks are special Tasks are preemptive based on priority –static: priorities assigned once at initialization –dynamic: priorities change during execution

Terminology Deadline –time of the next request for same task Feasible –no deadlines are missed Response time –time between request and completion of a task Critical instant –when a request for a task will have the largest response time –occurs when a task is requested simultaneously with requests for all higher priority tasks Critical time zone –time between a critical instant and the end of the response to the corresponding request of the lowest priority task

Example 1 T 1 = 2 C 1 = 1C 2 = 1 T 2 = 5 T1 is higher priority Utilization (U) =

Example 2 T 1 = 2 C 1 = 1C 2 = 2 T 2 = 5 T1 is higher priority Utilization (U) =

Feasibility Test If requests for all tasks at their critical instants can be fulfilled, then feasible Determine least upper bound of U –maximum utilization such that all deadlines are still satisfied, in the general case Assigning highest priority to task with the smallest period yields best utilization

Problem for Two Tasks Tasks (C 1, T 1 ) and (C 2, T 2 ), with T 1 < T 2 Within request period of T 2, there can be at most ceil(T 2 / T 1 ) requests from T 1 Adjust C 2 to fully utilize CPU

Case 1 Requests for task 1 completed within T 2 –no overlap with T 2 In this case, largest value of C 2 can be C 2 = T 2 – C 1 *ceil(T 2 /T 1 ) U = 1 + C 1 [ (1/T 1 ) – (1/T 2 ) *ceil(T 2 / T 1 )]

Case 2 Execution of ceil(T 2 /T 1 )th request from task 1 overlaps second request from task 2 –e.g. (C 1 =1,T 1 =1.5); (C 2 =1, T 2 =5) In this case, largest value of C 2 can be C 2 = T 1 *fl(T 2 /T 1 ) – C 1 *fl(T 2 /T 1 ) U = (T 1 /T 2 )*fl(T 2 /T 1 ) + C 1 [ (1/T 1 ) – (1/T 2 ) *fl(T 2 / T 1 )]

Minimum Occurs at Boundary Minimum of U occurs at the boundary between these two cases Set equations equal and solve for C 1 C 1 = T 2 – T 1 *fl(T 2 /T 1 ) U = 2(2 1/2 – 1) =~ 0.83 –highest utilization such that all deadlines met

General Case For two tasks –U < 2 (2 ½ - 1), ~= 0.83 For three tasks –U < 3 (2 1/3 - 1) ~= 0.78 For n tasks –U ln 2 ~= 0.69 If configuration of tasks pass the test, no deadlines will be missed –must limit utilization to 69% for large N !!!

Example Is this configuration of tasks admissible? C 1 = 1.5C 2 = 2.1 T 1 = 2.5T 2 = 6

Example Is this configuration of tasks admissible? C 1 = 1C 2 = 2 T 1 = 2T 2 = 4

Deadline Driven Scheduling (EDF) Assign priorities to tasks based on the deadlines of their current requests Execute task with highest priority and yet unfulfilled request Optimal scheduling algorithm –If tasks can be scheduled by any algorithm, then they can also be scheduled by EDF

Compare Rate Monotonic vs. EDF –C 1 = 1.5C 2 = 2.1 –T 1 = 2.5T 2 = 6 Draw timing models for each –show failure with RM, but success with EDF