CPU Scheduling. Jo, Heeseung

Similar documents
CPU Scheduling. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

CPU Scheduling. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

CPU Scheduling. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

CS 153 Design of Operating Systems Winter 2016

Scheduling I. Today. Next Time. ! Introduction to scheduling! Classical algorithms. ! Advanced topics on scheduling

Chapter 6: CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. CPU Scheduler. Dispatcher. Alternating Sequence of CPU And I/O Bursts

CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Unix Scheduler

Roadmap. Tevfik Ko!ar. CSC Operating Systems Spring Lecture - V CPU Scheduling - I. Louisiana State University.

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - V CPU Scheduling - I. University at Buffalo.

Project 2 solution code

Principles of Operating Systems

CPU Scheduling. Disclaimer: some slides are adopted from book authors and Dr. Kulkarni s slides with permission

Motivation. Types of Scheduling

Intro to O/S Scheduling. Intro to O/S Scheduling (continued)

Lecture 11: CPU Scheduling

Process Scheduling Course Notes in Operating Systems 1 (OPESYS1) Justin David Pineda

Recall: FCFS Scheduling (Cont.) Example continued: Suppose that processes arrive in order: P 2, P 3, P 1 Now, the Gantt chart for the schedule is:

Journal of Global Research in Computer Science

Operating System 9 UNIPROCESSOR SCHEDULING

Operating Systems Process Scheduling Prof. Dr. Armin Lehmann

Review of Round Robin (RR) CPU Scheduling Algorithm on Varying Time Quantum

A COMPARATIVE ANALYSIS OF SCHEDULING ALGORITHMS

A Paper on Modified Round Robin Algorithm

Uniprocessor Scheduling

CS162 Operating Systems and Systems Programming Lecture 10. Tips for Handling Group Projects Thread Scheduling

Advanced Types Of Scheduling

LEAST-MEAN DIFFERENCE ROUND ROBIN (LMDRR) CPU SCHEDULING ALGORITHM

Scheduling II. To do. q Proportional-share scheduling q Multilevel-feedback queue q Multiprocessor scheduling q Next Time: Memory management

Scheduling: Introduction

Pallab Banerjee, Probal Banerjee, Shweta Sonali Dhal

Process Scheduling for John Russo generated Mon Nov 07 13:57:15 EST 2011

Queue based Job Scheduling algorithm for Cloud computing

Mixed Round Robin Scheduling for Real Time Systems

Efficient Round Robin Scheduling Algorithm with Dynamic Time Slice

SELF OPTIMIZING KERNEL WITH HYBRID SCHEDULING ALGORITHM

The BEST Desktop Soft Real-Time Scheduler

Analysis of Adaptive Round Robin Algorithm and Proposed Round Robin Remaining Time Algorithm

Job Scheduling in Cluster Computing: A Student Project

Comparative Study of Parallel Scheduling Algorithm for Parallel Job

Motivating Examples of the Power of Analytical Modeling

GENERALIZED TASK SCHEDULER

ENGG4420 CHAPTER 4 LECTURE 3 GENERALIZED TASK SCHEDULER

Lecture Note #4: Task Scheduling (1) EECS 571 Principles of Real-Time Embedded Systems. Kang G. Shin EECS Department University of Michigan

Smarter Round Robin Scheduling Algorithm for Cloud Computing and Big Data

A Survey of Resource Scheduling Algorithms in Green Computing

IJRASET: All Rights are Reserved

3. Scheduling issues. Common approaches /2. Common approaches /1. Common approaches / /17 UniPD / T. Vardanega 06/03/2017

DEADLINE MONOTONIC ALGORITHM (DMA)

Priority-Driven Scheduling of Periodic Tasks. Why Focus on Uniprocessor Scheduling?

OPERATING SYSTEMS. Systems and Models. CS 3502 Spring Chapter 03

Real-Time and Embedded Systems (M) Lecture 4

Dynamic Fractional Resource Scheduling for HPC Workloads

Node Allocation In Grid Computing Using Optimal Resouce Constraint (ORC) Scheduling

Comparative Analysis of Scheduling Algorithms of Cloudsim in Cloud Computing

Real-Time Systems. Modeling Real-Time Systems

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

QUANTITATIVE EVALUATION OF JOB AND RESOURCES FOR BETTER SELECTION TO IMPROVE MAKESPAN IN GRID SCHEDULING

Job Scheduling based on Size to Hadoop

Gang Scheduling Performance on a Cluster of Non-Dedicated Workstations

10/1/2013 BOINC. Volunteer Computing - Scheduling in BOINC 5 BOINC. Challenges of Volunteer Computing. BOINC Challenge: Resource availability

Real-Time Scheduling Theory and Ada

CHAPTER 4 CONTENT October :10 PM

Energy-Efficient Scheduling of Interactive Services on Heterogeneous Multicore Processors

Production Job Scheduling for Parallel Shared Memory Systems

SCHEDULING AND CONTROLLING PRODUCTION ACTIVITIES

Hierarchical Job Scheduling for Clusters of Workstations

OPTIMAL ALLOCATION OF WORK IN A TWO-STEP PRODUCTION PROCESS USING CIRCULATING PALLETS. Arne Thesen

Dependency-aware and Resourceefficient Scheduling for Heterogeneous Jobs in Clouds

A note on \The Limited Performance Benets of. Migrating Active Processes for Load Sharing" Allen B. Downey and Mor Harchol-Balter

DeltaV Control Module Execution

Decentralized Preemptive Scheduling Across Heterogeneous Multi-core Grid Resources

On the Comparison of CPLEX-Computed Job Schedules with the Self-Tuning dynp Job Scheduler

"Value Stream Mapping How does Reliability play a role in making Lean Manufacturing a Success " Presented by Larry Akre May 17, 2007

Hadoop Fair Scheduler Design Document

A TECHNICAL LOOK INSIDE ASE 15.7 S HYBRID THREADED KERNEL

What is Waveless Processing and How Can It Optimize My Operation?

Classifying Scheduling Policies with Respect to Unfairness in an M/GI/1

Power-aware Work Stealing in Homogeneous Multicore Systems

Reference model of real-time systems

A COMPARATIVE ANALYSIS OF SCHEDULING POLICIES IN A DISTRIBUTED SYSTEM USING SIMULATION

EFFECT OF CROSS OVER OPERATOR IN GENETIC ALGORITHMS ON ANTICIPATORY SCHEDULING

Fairness and Efficiency in Web Server Protocols

Proceedings of the 2012 Winter Simulation Conference C. Laroque, J. Himmelspach, R. Pasupathy, O. Rose, and A.M. Uhrmacher, eds

Clock-Driven Scheduling

Application the Queuing Theory in the Warehouse Optimization Jaroslav Masek, Juraj Camaj, Eva Nedeliakova

Classifying Scheduling Policies with Respect to Unfairness in an M/GI/1

Analysis of SRPT Scheduling: Investigating Unfairness

Job Scheduling for Multi-User MapReduce Clusters

THE advent of large-scale data analytics, fostered by

EPOCH TASK SCHEDULING IN DISTRIBUTED SERVER SYSTEMS

The Portable Batch Scheduler and the Maui Scheduler on Linux Clusters*

Deployment of SAS Programming Contract Staff: Pathway to Sinkhole or Best Strategy for Programming Division? Parag Shiralkar, Eliassen Group, NJ, USA

Classification of Real-Time Systems

Utilization vs. Throughput: Bottleneck Detection in AGV Systems

Today s Papers. Composability is Essential. The Future is Parallel Software. EECS 262a Advanced Topics in Computer Systems Lecture 12

Swift mode changes in memory constrained real-time systems

Online Scheduling in Distributed Message Converter Systems

Lecture 6: Scheduling. Michael O Boyle Embedded Software

On the Impact of Reservations from the Grid on Planning-Based Resource Management

International Journal of Scientific & Engineering Research, Volume 7, Issue 12, December ISSN

Transcription:

CPU Scheduling Jo, Heeseung

CPU Scheduling (1) CPU scheduling Deciding which process to run next, given a set of runnable processes Happens frequently, hence should be fast Scheduling points 2

CPU Scheduling (2) Scheduling algorithm goals All systems - No starvation - Fairness: giving each process a fair share of the CPU - Balance: keeping all parts of the system busy Batch systems - Throughput: maximize jobs per hour - Turnaround time: minimize time between submission and termination - CPU utilization: keep the CPU busy all the time Interactive systems - Response time: respond to requests quickly - Proportionality: meet users' expectations Real-time systems - Meeting deadlines: avoid losing data - Predictability: avoid quality degradation in multimedia system 3

CPU Scheduling (3) Starvation A situation where a process is prevented from making progress because another process has the resource it requires - Resource could be the CPU or a lock A poor scheduling policy can cause starvation - If a high-priority process always prevents a low-priority process from running on the CPU Synchronization can also cause starvation - One thread always beats another when acquiring a lock - Constant supply of readers always blocks out writers 4

CPU Scheduling (4) Non-preemptive scheduling The scheduler waits for the running job to voluntarily yield the CPU Jobs should be cooperative Preemptive scheduling The scheduler can interrupt a job and force a context switch What happens - If a process is preempted in the midst of updating the shared data? - If a process in a system call is preempted? 5

Execution Characteristics (1) CPU burst vs. I/O burst A CPU-bound process An I/O-bound process 6

Execution Characteristics (2) Histogram of CPU-burst Times Most are short CPU burst Rarely long CPU burst Reference for CPU scheduling algorithm design 7

FCFS/FIFO First-Come, First-Served / First-In, First-Out Jobs are scheduled in order that they arrive "Real-world" scheduling of people in lines - e.g., supermarket, bank tellers, McDonalds, etc. Typically, non-preemptive Jobs are treated equally: no starvation Problems Average waiting time can be large if small jobs wait behind long ones - Basket vs. cart May lead to poor overlap of I/O and CPU 8

SJF Shortest Job First Choose the job with the smallest expected CPU burst Can prove that SJF has optimal min. average waiting time - Only when all jobs are available simultaneously Non-preemptive Problems Impossible to know the size of future CPU burst Can you make a reasonable guess? Can potentially starve 9

SRTF Shortest Remaining Time First Preemptive version of SJF If a new process arrives with CPU burst length less than remaining time of current executing process, preempt Process Arrival Time P 1 0.0 7 P 2 2.0 4 P 3 4.0 1 P 4 5.0 4 Burst 0 0 P 1 P 3 P 2 P 4 SJF 7 8 12 16 P 1 P 2 P 3 P 2 P 4 P 1 2 4 5 SRTF 7 11 16 10

RR Round Robin Ready Q is treated as a circular FIFO Q Each job is given a time slice (or time quantum) - Usually 10-100 ms Great for timesharing - No starvation - Typically, higher average turnaround time than SJF, but better response time Preemptive What do you set the quantum to be? - A rule of thumb: 80% of the CPU bursts should be shorter than the time quantum Treats all jobs equally 11

Example of RR with Time Quantum = 4 Process Burst Time P 1 24 P 2 3 P 3 7 P 1 P 2 P 3 P 1 P 3 P 1 P 1 P 1 P 1 0 4 7 11 15 18 22 26 30 34 12

Exercise FCFS Process Arrival Time P 1 0.0 3 P 2 1.0 5 P 3 2.0 7 P 4 5.0 6 P 5 6.0 3 Burst 0 5 10 15 20 25 13

Exercise SJF Process Arrival Time P 1 0.0 3 P 2 1.0 5 P 3 2.0 7 P 4 5.0 6 P 5 6.0 3 Burst 0 5 10 15 20 25 14

Exercise SRTF Process Arrival Time P 1 0.0 3 P 2 1.0 5 P 3 2.0 7 P 4 5.0 6 P 5 6.0 3 Burst 0 5 10 15 20 25 15

Exercise RR (Q = 4) Process Arrival Time P 1 0.0 3 P 2 1.0 5 P 3 2.0 7 P 4 5.0 6 P 5 6.0 3 Burst 0 5 10 15 20 25 16

Exercise RR (Q = 5) Process Arrival Time P 1 0.0 3 P 2 1.0 5 P 3 2.0 7 P 4 5.0 6 P 5 6.0 3 Burst 0 5 10 15 20 25 17

Priority Scheduling (1) Priority scheduling Choose job with highest priority to run next SJF = Priority scheduling, where priority = expected length of CPU burst Round-robin or FIFO within the same priority Can be either preemptive or non-preemptive Priority is dynamically adjusted Modeled as a Multi-level Feedback Queue (MLFQ) 18

Priority Scheduling (2) Starvation problem If there is an endless supply of high priority jobs, no low priority job will ever run Solution: Aging Increase priority as a function of wait time Decrease priority as a function of CPU time Many ugly heuristics have been explored in this area 19