Scheduling Strategies Operating Systems Spring 2004 Class #10.

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

A. Frank - P. Weisberg Operating Systems Advanced CPU Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Chap 5 Process Scheduling. Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU–I/O Burst Cycle – Process execution consists of a.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Operating Systems CPU Scheduling. Agenda for Today What is Scheduler and its types Short-term scheduler Dispatcher Reasons for invoking scheduler Optimization.
Scheduling Algorithms
CPU Scheduling Algorithms
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.
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
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5-CPU Scheduling
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 5: CPU Scheduling.
Job scheduling Queue discipline.
Scheduling. Model of Process Execution Ready List Ready List Scheduler CPU Resource Manager Resource Manager Resources Preemption or voluntary yield AllocateRequest.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
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 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Scheduler What is the job of.
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
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.
CPU S CHEDULING Lecture: Operating System Concepts Lecturer: Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
ICS Principles of Operating Systems Lecture 5 - CPU Scheduling Prof. Nalini Venkatasubramanian
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.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
Peng Lu. CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Multiple-Processor Scheduling 5. Real-Time Scheduling 2.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
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.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 5: CPU Scheduling Basic.
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.
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.
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.
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.
CPU Scheduling Algorithms CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
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.
CPU SCHEDULING.
Chapter 5a: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Operating System Concepts
Chapter 5: CPU Scheduling
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter 6: CPU Scheduling
Outline Scheduling algorithms Multi-processor scheduling
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Presentation transcript:

Scheduling Strategies Operating Systems Spring 2004 Class #10

Scheduling Strategies  The job of the scheduling strategy is to select the next Ready process to enter the Running state. Ready List Ready List CPU Resource Manager Resource Manager Resources Preemption or voluntary yield AllocateRequest Done New Process process “Ready”“Running” “Blocked” process Scheduler Strategy

Some Scheduling Strategies  Non-Preemptive Strategies: First-Come-First-Served (FCFS) Priority * Shortest Job Next (SJN) * * These also come in a preemptive flavor.  Preemptive Strategies: Round Robin Multi-level Queue Multi-level Feedback Queue

Evaluating Scheduling Strategies  Some metrics that are useful in evaluating scheduling strategies: CPU Utilization: The percentage of time that the CPU spends executing code on behalf of a user. Throughput: The average number of processes completed per time unit. Turnaround Time * : The total time from when a process first enters the Ready state to last time it leaves the Running state. Wait Time * : The time a process spends in the Ready state before its first transition to the Running state. Waiting Time * : The total time that a process spends in the Ready state. Response Time * : The average amount of time that a process spends in the Ready state. * These metrics are typically averaged across a collection of processes.

Comparing Scheduling Strategies  There are many techniques for comparing scheduling strategies: Deterministic Modeling Queuing Models Simulation Implementation

Deterministic Modeling  In deterministic modeling we’ll ignore I/O operations and voluntary yields. Ready List Ready List CPU Resource Manager Resource Manager Resources Preemption or voluntary yield AllocateRequest Done New Process process “Ready”“Running” “Blocked” process Scheduler Strategy

FCFS Example ArrivalCPU OrderBurst p0p0 p1p1 p2p2 p3p3 p4p Gantt Chart:

SJN Example  SJN: Guaranteed minimum average wait time. May result in starvation of large jobs. Need to know the CPU burst times. ArrivalCPU OrderBurst p0p0 p1p1 p2p2 p3p3 p4p Gantt Chart:

RR Example (w/ 50tu Time Slice) ArrivalCPU OrderBurst p0p p4p4 p1p1 p0p0 p4p4 p3p3 p2p2 p1p1 p1p1 p2p2 p3p3 p0p0 p3p3 p2p2 p0p0 p3p3 p2p2 p0p0 p3p3 p2p2 p0p0 p2p2 p0p0 p2p2 p2p2 p2p2 p2p Gantt Chart:

RR Example (w/ 50 tu Overhead) p0p p4p4 p1p1 p0p0 p4p4 p3p3 p2p2 p1p1 p1p1 p2p2 p3p3 p0p0 p3p3 p2p2 p0p0 p3p3 p2p2 p0p0 p3p3 p2p2 p0p0 p2p2 p0p0 p2p2 p2p2 p2p2 p2p Gantt Chart:  Throughput, turnaround, wait, waiting and response time calculations must now include the overhead.

Multi-Level Queues  For i < j All processes at level i run before any process at level j.  Each list may use its own strategy. Ready List 0 Ready List 1 Ready List 2 Ready List N-1 Scheduler CPU Preemption or voluntary yield Done New Process

Linux Scheduling  Linux uses a multi-level queue scheduling strategy: All threads in FIFO run before any in RR which run before any in OTHER. Within each queue a priority scheme is used with higher priority threads running first. User threads run in the OTHER queue. All queues are preemptive. FIFO RR OTHER Scheduler CPU Done New Process Preemption or voluntary yield

Linux OTHER Queue Scheduling  The OTHER queue uses the following strategy: Each thread, i, has a priority p i  Every new thread is given a default priority, K. A countdown timer is used to create time slices.  On each timer interrupt the priority of the running thread is decremented (p i --). When a thread’s priority reaches 0, it is blocked.  The highest priority thread is selected to run for the next time slice. If no threads are available (i.e. all threads are blocked on a resource or because they have 0 priority), then a recrediting operation is performed. During recrediting, every thread in the system is assigned priority using the following formula: Threads blocked for 0 priority now return to the ready queue.

Multi-Level Feedback Queues  For i < j All processes at level i run before any process at level j.  Processes are inserted into queues by priority. Process priorities are updated dynamically. Each queue typically uses a RR strategy.  Popular in Modern OS: Windows BSD Ready List 0 Ready List 1 Ready List 2 Ready List N-1 Scheduler CPU Preemption or voluntary yield Done New Process

Scheduling Simulations  Scheduling simulations account for several important factors that are frequently ignored by deterministic modeling: Scheduling Overhead I/O Operations Process Profiles:  CPU Bound  I/O Bound Variable process arrival times.

Project  Implement the RR and Linux OTHER scheduling strategies and compare their performance on: I/O Bound Processes CPU Bound Processes A mix of CPU and I/O Bound Processes