LSN 15 Processor Scheduling

Similar documents
Process Scheduling. Process Scheduling. CPU and I/O Bursts. CPU - I/O Burst Cycle. Variations in Bursts. Histogram of CPU Burst Times

2/5/07 CSE 30341: Operating Systems Principles

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

Chapter 6: CPU Scheduling

CPU scheduling. CPU Scheduling

Real-time operating systems course. 6 Definitions Non real-time scheduling algorithms Real-time scheduling algorithm

Module 5: CPU Scheduling

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

CS 550 Operating Systems Spring CPU scheduling I

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

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

CHAPTER 5 - PROCESS SCHEDULING

CPU Scheduling. CPU Scheduler

CPU SCHEDULING RONG ZHENG

CSE 380 Computer Operating Systems

Comp 204: Computer Systems and Their Implementation. Lecture 11: Scheduling cont d

Simulation of Process Scheduling Algorithms

TDDI04, K. Arvidsson, IDA, Linköpings universitet CPU Scheduling. Overview: CPU Scheduling. [SGG7] Chapter 5. Basic Concepts.

TDDB68 Concurrent programming and operating systems. Lecture: CPU Scheduling II

Season Finale: Which one is better?

CPU Scheduling. Heechul Yun

Last class: Today: Threads. CPU Scheduling

CPU Scheduling Exercises

CS 370. FCFS, SJF and Round Robin. Yashwanth Virupaksha and Abhishek Yeluri

Journal of Global Research in Computer Science

NATCOR: Stochastic Modelling

Design and Performance Evaluation of a New Proposed Shortest Remaining Burst Round Robin (SRBRR) Scheduling Algorithm

3. Scheduling issues. Common approaches 3. Common approaches 1. Preemption vs. non preemption. Common approaches 2. Further definitions

Revamped Round Robin Scheduling Algorithm

CIS 4930/6930: Principles of Cyber-Physical Systems

ENHANCING CPU PERFORMANCE USING SUBCONTRARY MEAN DYNAMIC ROUND ROBIN (SMDRR) SCHEDULING ALGORITHM

CEC 450 Real-Time Systems

Real-Time Systems. Event-Driven Scheduling

February 2011 Page 23 of 93 ISSN

Aperiodic Task Scheduling

COMPARATIVE PERFORMANCE ANALYSIS OF MULTI-DYNAMIC TIME QUANTUM ROUND ROBIN (MDTQRR) ALGORITHM WITH ARRIVAL TIME

Improvising Round Robin Process Scheduling through Dynamic Time Quantum Estimation

Real-time Scheduling of Periodic Tasks (1) Advanced Operating Systems Lecture 2

PBS: A Unified Priority-Based CPU Scheduler

Scheduling. Uwe R. Zimmer & Alistair Rendell The Australian National University

Networked Embedded Systems WS 2016/17

Task Models and Scheduling

CEC 450 Real-Time Systems

Andrew Morton University of Waterloo Canada

Lecture 6. Real-Time Systems. Dynamic Priority Scheduling

Real-Time Scheduling and Resource Management

Process Scheduling for RTS. RTS Scheduling Approach. Cyclic Executive Approach

Deadline-driven scheduling

Dynamic Time Quantum based Round Robin CPU Scheduling Algorithm

Real-Time Scheduling. Real Time Operating Systems and Middleware. Luca Abeni

Lecture Note #6: More on Task Scheduling EECS 571 Principles of Real-Time Embedded Systems Kang G. Shin EECS Department University of Michigan

DETERMINING THE VARIABLE QUANTUM TIME (VQT) IN ROUND ROBIN AND IT S IMPORTANCE OVER AVERAGE QUANTUM TIME METHOD

ODSA: A Novel Ordering Divisional Scheduling Algorithm for Modern Operating Systems

Administrivia. Course Objectives. Overview. Lecture Notes Week markem/cs333/ 2. Staff. 3. Prerequisites. 4. Grading. 1. Theory and application

Clock-driven scheduling

Scheduling IoT on to the Cloud : A New Algorithm

11 The M/G/1 system with priorities

Real-Time Systems. Event-Driven Scheduling

A new Hybridized Multilevel Feedback Queue Scheduling with Intelligent Time Slice and its Performance Analysis

Non-Preemptive and Limited Preemptive Scheduling. LS 12, TU Dortmund

Journal of Global Research in Computer Science

Half Life Variable Quantum Time Round Robin (HLVQTRR)

A NEW PROPOSED DYNAMIC DUAL PROCESSOR BASED CPU SCHEDULING ALGORITHM

Cyclic Schedules: General Structure. Frame Size Constraints

EXTRA THRESHOLD IN ROUND ROBIN ALGORITHM IN MULTIPROCESSOR SYSTEM

On-line scheduling of periodic tasks in RT OS

An Improved Round Robin Approach using Dynamic Time Quantum for Improving Average Waiting Time

Efficient Dual Nature Round Robin CPU Scheduling Algorithm: A Comparative Analysis

Analysis of Round-Robin Implementations of Processor Sharing, Including Overhead

International Journal of Advanced Research in Computer Science and Software Engineering

Improved Deadline Monotonic Scheduling With Dynamic and Intelligent Time Slice for Real-time Systems

ENHANCING THE CPU PERFORMANCE USING A MODIFIED MEAN- DEVIATION ROUND ROBIN SCHEDULING ALGORITHM FOR REAL TIME SYSTEMS.

A Theory of Rate-Based Execution. A Theory of Rate-Based Execution

Scheduling Algorithms for Multiprogramming in a Hard Realtime Environment

Lecture 13. Real-Time Scheduling. Daniel Kästner AbsInt GmbH 2013

Real-Time Scheduling

Embedded Systems Development

A FAST MATRIX-ANALYTIC APPROXIMATION FOR THE TWO CLASS GI/G/1 NON-PREEMPTIVE PRIORITY QUEUE

Embedded Systems 14. Overview of embedded systems design

Lab Course: distributed data analytics

ENHANCING THE CPU PERFORMANCE USING A MODIFIED MEAN- DEVIATION ROUND ROBIN SCHEDULING ALGORITHM FOR REAL TIME SYSTEMS

Online Energy-Aware I/O Device Scheduling for Hard Real-Time Systems with Shared Resources

Task Reweighting under Global Scheduling on Multiprocessors

A Dynamic Real-time Scheduling Algorithm for Reduced Energy Consumption

Computing the Signal Duration to Minimize Average Waiting Time using Round Robin Algorithm

A Utilization Bound for Aperiodic Tasks and Priority Driven Scheduling

Servers. Rong Wu. Department of Computing and Software, McMaster University, Canada. Douglas G. Down

Determining the Optimum Time Quantum Value in Round Robin Process Scheduling Method

Research Article Designing of Vague Logic Based 2-Layered Framework for CPU Scheduler

Supplement of Improvement of Real-Time Multi-Core Schedulability with Forced Non- Preemption

Real-Time Systems. Lecture #14. Risat Pathan. Department of Computer Science and Engineering Chalmers University of Technology

Probabilistic Preemption Control using Frequency Scaling for Sporadic Real-time Tasks

EDF Feasibility and Hardware Accelerators

Non-preemptive Fixed Priority Scheduling of Hard Real-Time Periodic Tasks

Contents Preface The Exponential Distribution and the Poisson Process Introduction to Renewal Theory

Lecture 4: Process Management

Exercises Stochastic Performance Modelling. Hamilton Institute, Summer 2010

CS 700: Quantitative Methods & Experimental Design in Computer Science

Real-Time Systems. LS 12, TU Dortmund

Transcription:

LSN 15 Processor Scheduling ECT362 Operating Systems Department of Engineering Technology

LSN 15 Processor Scheduling

LSN 15 FCFS/FIFO Scheduling Each process joins the Ready queue When the current process ceases to execute, the oldest process in the Ready queue is selected A short process may have to wait a very long time before it can execute Favors CPU-bound processes I/O processes have to wait until CPU-bound process completes

LSN 15 FCFS/FIFO Scheduling Process t(p i ) 0 350 1 125 2 475 3 250 4 75 0 350 475 950 1200 1275 p 0 p 1 p 2 p 3 p 4 T TRnd (p 0 ) = t(p 0 ) = 350 T TRnd (p 1 ) = (t(p 1 ) +T TRnd (p 0 )) = 125+350 = 475 T TRnd (p 2 ) = (t(p 2 ) +T TRnd (p 1 )) = 475+475 = 950 T TRnd (p 3 ) = (t(p 3 ) +T TRnd (p 2 )) = 250+950 = 1200 T TRnd (p 4 ) = (t(p 4 ) +T TRnd (p 3 )) = 75+1200 = 1275 T TRnd (AVG) = 850

LSN 15 Priority Based Scheduling Scheduler will always choose a process of higher priority over one of lower priority Have multiple ready queues to represent each level of priority

LSN 15 Priority Based Scheduling Process t(p i ) Pri 0 350 5 1 125 2 2 475 3 3 250 1 4 75 4 0 250 375 850 925 p 3 p 1 p 2 p 4 p 0 1275 T TRnd (p 0 ) = t(p 0 )+t(p 4 )+t(p 2 )+t(p 1 ) )+t(p 3 ) = 350+75+475+125+250 = 1275 T TRnd (p 1 ) = t(p 1 )+t(p 3 ) = 125+250 = 375 T TRnd (p 2 ) = t(p 2 )+t(p 1 )+t(p 3 ) = 475+125+250 = 850 T TRnd (p 3 ) = t(p 3 ) = 250 T TRnd (p 4 ) = t(p 4 )+ t(p 2 )+ t(p 1 )+t(p 3 ) = 75+475+125+250 = 925 T TRnd (AVG) = 735

LSN 15 Round Robin Scheduling Uses preemption based on a clock Clock interrupt is generated at periodic intervals When an interrupt occurs, the currently running process is placed in the read queue Next ready job is selected Known as time slicing

LSN 15 Round Robin Scheduling Process t(p i ) 0 350 1 125 2 475 3 250 4 75 0 p 0 100 200 300 400 475 550 650 p 1 p 2 p 3 p 4 p 0 p 1 p 2 p 3 p 4 p 0 p 1 p 2 p 3 650 750 850 950 1050 1150 1250 1275 p 0 p 2 p 3 p 0 p 2 p 3 p 0 p 2 p 0 p 2 p 2 p 2 p 2 T TRnd (p 0 ) = 1100 T TRnd (p 1 ) = 550 T TRnd (p 2 ) = 1275 T TRnd (p 3 ) = 950 T TRnd (p 4 ) = 475 T TRnd (AVG) = 870

LSN 15 Round Robin Scheduling Process t(p i ) 0 350 1 125 2 475 3 250 4 75 T TRnd (p 0 ) = 1320 T TRnd (p 1 ) = 660 T TRnd (p 2 ) = 1535 T TRnd (p 3 ) = 1140 T TRnd (p 4 ) = 565 T TRnd (AVG) = 1044 0 120 240 360 480 540 575 635 670 p 0 p 1 p 2 p 3 p 4 p 0 p 1 p 2 p 3 p 4 p 0 p 1 790 910 1030 1150 1270 p 2 p 0 p 2 p 3 p 0 p 2 p 0 p 2 p 3 p 0 p 3 1390 1510 1535 p 2 p 2 p 2 p 2

LSN 15 Shortest Process Next Scheduling Nonpreemptive policy Process with shortest expected processing time is selected next Short process jumps ahead of longer processes in ready queue Predictability of longer processes is reduced If estimated time for process not correct, the operating system may abort it

LSN 15 Shortest Process Next Scheduling Process t(p i ) 0 350 1 125 2 475 3 250 4 75 0 p 4 75 200 450 800 p 1 p 3 p 0 p 2 1275 T TRnd (p 0 ) = t(p 0 )+t(p 3 )+t(p 1 )+t(p 4 ) = 350+250+125+75 = 800 T TRnd (p 1 ) = t(p 1 )+t(p 4 ) = 125+75 = 200 T TRnd (p 2 ) = t(p 2 )+t(p 0 )+t(p 3 )+t(p 1 )+t(p 4 ) = 475+350+250+125+75 = 1275 T TRnd (p 3 ) = t(p 3 )+t(p 1 )+t(p 4 ) = 250+125+75 = 450 T TRnd (p 4 ) = t(p 4 ) = 75 T TRnd (AVG) = 560

LSN 15 Implementing The Scheduler From Other States Ready Process Process Descriptor Enqueuer Ready List Dispatcher Context Switcher CPU Running Process

LSN 15 Implementing The Scheduler Voluntary CPU sharing Each process/thread will explicitly invoke the scheduler periodically Some hardware uses a yield() instruction to allow a process to release the CPU Nonpreemptive scheduling Involuntary CPU sharing Timer interrupt Preemptive scheduling

LSN 15 Windows Thread Scheduling Multi-level feedback Tries to provide very high levels of service to threads that need very rapid responses Uses programmable interval times (20 200 ms) Supports 32 different scheduling levels 16 highest priority queues real-time level queues Next 15 priority queues variable level queues Lowest level queue system level queue Fully preemptive scheduling All threads that are ready to run are placed into their appropriate priority level queues

LSN 15 Linux Scheduling Mechanism Dispatcher is the kernel function schedule() Called by system functions after every system call and normal interrupt Inspects the set of tasks in TASK_RUNNING state Scheduling policy is a variant of round robin scheduling Uses a conventional time slicing mechanism Uses a computed dynamic priority Dispatcher selects process with maximum counter value

LSN 15 Homework Reading Chapter 9.1 9.2