Aperiodic Task Scheduling

Similar documents
Introduction to Embedded Systems

Simplified design flow for embedded systems

1.1 Explain the difference between fast computing and real-time computing.

Event-Driven Scheduling. (closely following Jane Liu s Book)

CS4514 Real Time Scheduling

Microkernel/OS and Real-Time Scheduling

Real-time operating systems and scheduling

Announcements. CSEP 521 Applied Algorithms. Announcements. Polynomial time efficiency. Definitions of efficiency 1/14/2013

Introduction to Real-Time Systems ECE 397-1

Concurrent activities in daily life. Real world exposed programs. Scheduling of programs. Tasks in engine system. Engine system

Homework index. Processing resource description. Goals for lecture. Communication resource description. Graph extensions. Problem definition

Chapter 16. Greedy Algorithms

Greedy Algorithms. T. M. Murali. January 28, Interval Scheduling Interval Partitioning Minimising Lateness

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #8: Task Assignment and Scheduling on Multiprocessor Systems

Exam Review TexPoint fonts used in EMF.

Applied Algorithm Design Lecture 3

Overview of Scheduling a Mix of Periodic and Aperiodic Tasks

Authors Abugchem, F. (Fathi); Short, M. (Michael); Xu, D. (Donglai)

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

4/6/2011. Informally, scheduling is. Informally, scheduling is. More precisely, Periodic and Aperiodic. Periodic Task. Periodic Task (Contd.

Introduction to Embedded Systems

Penalty Minimization in Scheduling a Set of Soft Real-Time Tasks

Data Structures (CS 1520) Lecture 28 Name:

Real-Time Architectures 2004/2005

Schedulability with resource sharing. Priority inheritance protocol Priority ceiling protocol Stack resource policy

CSE 237A Timing and scheduling. Tajana Simunic Rosing Department of Computer Science and Engineering University of California, San Diego.

Global Scheduling in Multiprocessor Real-Time Systems

CLASS: II YEAR / IV SEMESTER CSE CS 6402-DESIGN AND ANALYSIS OF ALGORITHM UNIT I INTRODUCTION

Effects of Hard Real-Time Constraints in Implementing the Myopic Scheduling Algorithm

Introduction to Real-time Systems. Advanced Operating Systems (M) Lecture 2

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling

Precedence Graphs Revisited (Again)

Algorithm Design Methods. Some Methods Not Covered

Fault tolerant scheduling in real time systems

Multiprocessor and Real-Time Scheduling. Chapter 10

6.1 Motivation. Fixed Priorities. 6.2 Context Switch. Real-time is about predictability, i.e. guarantees. Real-Time Systems

Embedded Systems: OS. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Contents. 1 Introduction. 2 Searching and Traversal Techniques. Preface... (vii) Acknowledgements... (ix)

Reference Model and Scheduling Policies for Real-Time Systems

Backtracking. Chapter 5

Data Structures (CS 1520) Lecture 28 Name:

Embedded Systems: OS

7. Multimedia Operating System. Contents. 7.3 Resource Management. 7.4 Process Management. 7.2 Real Time Systems. 7.5 Prototype Systems. 7.

Constraint Satisfaction Problems

Chapter 5: Distributed Process Scheduling. Ju Wang, 2003 Fall Virginia Commonwealth University

Approximation Algorithms

Multimedia Systems 2011/2012

arxiv: v2 [cs.ds] 22 Jun 2016

Preemptive Scheduling of Equal-Length Jobs in Polynomial Time

Programming Assignment HW5: CPU Scheduling draft v04/02/18 4 PM Deadline April 7th, 2018, 5 PM. Late deadline with penalty April 9th, 2018, 5 PM

Scheduling. Job Shop Scheduling. Example JSP. JSP (cont.)

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Scheduling Algorithm and Analysis

Operating Systems ECE344. Ding Yuan

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Resource-bound process algebras for Schedulability and Performance Analysis of Real-Time and Embedded Systems

Time Triggered and Event Triggered; Off-line Scheduling

CAD Algorithms. Categorizing Algorithms

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

Computer Systems Assignment 4: Scheduling and I/O

Real-Time Scheduling. Dynamic Priority Servers

Scheduling on clusters and grids

CS6402 Design and Analysis of Algorithm. 2 Marks Question & Answer UNIT I INTRODUCTION

Copyright Notice. COMP9242 Advanced Operating Systems S2/2014 Week 9: Real-Time Systems. Real-Time System: Definition

Deductive Methods, Bounded Model Checking

CS 440 Theory of Algorithms /

Discrete Optimization. Lecture Notes 2

Furious activity is no substitute for understanding. -- H. H. Williams. Chapter 4. Scheduling P1 T4 T5

Mixed Criticality Scheduling in Time-Triggered Legacy Systems

Local-Deadline Assignment for Distributed Real-Time Systems

CS 188: Artificial Intelligence Fall 2008

Announcements. CS 188: Artificial Intelligence Fall Large Scale: Problems with A* What is Search For? Example: N-Queens

Single Machine Scheduling with Interfering Job Sets. Arizona State University PO Box Tempe, AZ

3 No-Wait Job Shops with Variable Processing Times

Scheduling. Scheduling. Scheduling. Scheduling Criteria. Priorities. Scheduling

Introduction to Combinatorial Algorithms

CSE 473: Artificial Intelligence

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institution of Technology, IIT Delhi

Department of Computer Applications. MCA 312: Design and Analysis of Algorithms. [Part I : Medium Answer Type Questions] UNIT I

Practice Exercises 305

D.K.M.COLLEGE FOR WOMEN (AUTONOMOUS), VELLORE-1.

Some Applications of Graph Bandwidth to Constraint Satisfaction Problems

Lecture 9: Load Balancing & Resource Allocation

Transforming Distributed Acyclic Systems into Equivalent Uniprocessors Under Preemptive and Non-Preemptive Scheduling

6. Algorithm Design Techniques

Partitioned Scheduling of P-FRP in Symmetric Homogenous Multiprocessors *

CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Project 1 (document version 1.3) Process Simulation Framework

Lecture 12: An Overview of Scheduling Theory

Analyzing Real-Time Systems

ISE480 Sequencing and Scheduling

Off-line (Optimal) Multiprocessor Scheduling of Dependent Periodic Tasks

2. Introduction to Software for Embedded Systems

1.1 CPU I/O Burst Cycle

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

Constraint Satisfaction Problems (CSPs)

Preview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System

2. Software Introduction

Offline Equivalence: A Non-Preemptive Scheduling Technique for Resource-Constrained Embedded Real-Time Systems

INSTITUTE OF AERONAUTICAL ENGINEERING

Scheduling in Multiprocessor System Using Genetic Algorithms

Transcription:

Aperiodic Task Scheduling Radek Pelánek

Preemptive Scheduling: The Problem 1 processor arbitrary arrival times of tasks preemption performance measure: maximum lateness no resources, no precedence constraints

Example 1 Solve the example (manually). 2 Try to find out a scheduling algorithm.

Earliest Deadline First Earliest Deadline First Algorithm EDF At any instant execute the task with the earliest absolute deadline among all the ready tasks.

Earliest Deadline First Example EDF Schedule

Earliest Deadline First Optimality of EDF Theorem (Horn) Given a set of n independent tasks with arbitrary arrival times, the EDF algorithm is optimal with respect to minimazing the maximum lateness.

Earliest Deadline First Proof of Horn s Theorem Basic idea of the proof: let σ be optimal schedule; we transform it into EDF schedule σ EDF without increasing maximum lateness schedule is divided into time slices of 1 unit transformation: interchange 1 appropriate time slice

Earliest Deadline First Proof of Horn s Theorem (cont.)

Earliest Deadline First Guarantee Test is the set of tasks schedulable? sort tasks by increasing deadlines synchronous activation (a i = 0) schedulability guaranteed by conditions: i : Σ i k=1c k d i asynchronous activation: dynamical version of the previous test

Earliest Deadline First EDF is Fine... EDF: is optimal works on-line easy to implement simple guarantee test

Earliest Deadline First... but Not a Silver Bullet EDF is not optimal with more than 1 processor Try to find a specific set of tasks: the set is schedulable on 2 processor EDF schedule misses some deadline

Earliest Deadline First EDF with More Processors 2 Processors J 1 J 2 J 3 a i 0 0 0 C i 1 1 5 d i 1 2 5 Schedulable, but EDF schedule misses deadline for J 3.

Least Slack Time Least Slack Time Algorithm LST At any instant execute the task with the least slack time (that is d i C i ) among all the ready tasks. LST is also optimal.

Least Slack Time Example Find a set of task such that EDF and LST produce different schedules.

Non-preemptive Scheduling: The Problem 1 processor arbitrary arrival times of tasks preemption not allowed performance measure: maximum lateness no resources, no precedence constraints

EDF Non-optimality of EDF EDF is not optimal for non-preemptive scheduling. Find a set of task such that EDF does not produce optimal schedule.

EDF Non-optimality of EDF

EDF EDF and Non-idle Schedules non-idle algorithm - does not permit the processor to be idle when there are active jobs restriction to non-idle algorithms EDF is optimal

Brute Force Optimal Scheduling no on-line algorithm can generate optimal schedule (example above: time 0, stay idle or start J 1?) off-line: non-preemptive scheduling is NP-complete branch-and-bound (backtracking) algorithms, worst case complexity O(n n!)

Brute Force Search Tree

Brute Force Reminder: Backtracking, n Queen Problem

Brute Force Pruning branch is abandoned when: the addition of any node to the current path causes a missed deadline a feasible schedule is found at the current path size of the search tree is exponential in the worst case significant pruning in the average case

Brute Force Pruning: Example

Brute Force Example J 1 J 2 J 3 J 4 a i 0 4 2 6 C i 6 2 4 2 d i 18 8 9 10 Draw the search tree (with pruning).

Scheduling with Precedence Constraints generally NP-complete we consider two special cases, polynomial algorithms remark on heuristical approach

Latest Deadline First Precedence Constraints: Problem 1 1 processor precedence constraints synchronous activation ( i : a i = 0) (preemption does not matter) performance measure: maximum lateness

Latest Deadline First Example 1 solve the example (manually) 2 construct the EDF schedule 3 try to find out an optimal scheduling algorithm

Latest Deadline First Latest Deadline First Algorithm one possible solution: latest deadline first (LDF) note: different interpretations EDF algorithm = earliest deadline job is scheduled to run first LDF algorithm = latest deadline job is put into schedule first

Latest Deadline First Latest Deadline First Algorithm LDF among tasks without successors select the task with the latest deadline remove this task from the precedence graph and put it into a stack repeat until all tasks are in the stack the stack represents the order in which tasks should be scheduled LDF is optimal.

Latest Deadline First LDF: example

Modified EDF Precedence Constraints: Problem 2 1 processor precedence constraints arbitrary arrival times of tasks preemption performance measure: maximum lateness

Modified EDF Example Precedence constraints: A C; A D; B D, B E; E D; C F ; D F A B C D E F a 0 2 5 4 1 2 C 3 2 2 3 1 3 d 8 8 13 10 5 14

Modified EDF Basic Idea 1 transform set J of dependent tasks into set J of independent tasks 2 apply EDF to set J transformation done by modification of arrival times and deadline times

Modified EDF Modification of Arrival Times If J Y J X then: s X a X J X cannot start earlier than its activation time s X a Y + C Y J X cannot start earliear than the minimum finishing time of J Y

Modified EDF Modification of Arrival Times (cont.) new arrival time: a X = max(a X, max(a Y + C Y, J Y J X )) modified arrival time must be computed in the correct order (given by precedence constraints)

Modified EDF Modification of Deadlines If J X J Y then: f X d X J X must finish within its deadline f X d Y C Y J X must finish not later than the maximum starting time of J Y

Modified EDF Modification of Deadlines (cont.) new deadline: d X = min(d X, min(d Y C Y, J X J Y )) modified deadline times must be computed in the correct order (given by precedence constraints)

Modified EDF Optimality Theorem There exists feasible schedule for the modified task set J under EDF if and only if the original task set is schedulable.

Modified EDF Example Precedence constraints: A C; A D; B D, B E; E D; C F ; D F A B C D E F a 0 2 5 4 1 2 C 3 2 2 3 1 3 d 8 8 13 10 5 14 a 0 2 5 5 4 8 d 7 4 11 10 5 14

Modified EDF Example precedence constraints: A C, B C, C E, D F, B D, C F, D G all tasks: a i = 0, D i = 25, computation times: 2, 3, 3, 5, 1, 2, 5 compute modified arrival times and deadlines compute schedule according to EDF

Heuristical algorithms Heuristical search more complicated problems (e.g., non-preemptive, precedence constraints) NP-complete brute-force search (with pruning) heuristical search only some schedules are considered no guarantee of optimality note: general computer science approach

Heuristical algorithms Heuristical search constructs partial schedules (like brute-force search) considers only one (or few) tasks for extension of a schedule selection based on heuristic function H

Heuristical algorithms Heuristic function H(i) = a i H(i) = C i H(i) = d i first come first serve shortest job first earliest deadline first more complicated parameters (taking into account precedence relations, resources,...) weighted combinations of different parameters

Overview of Problems and Algorithms independent precedence sync. act. EDF, O(n log n) LDF, O(n 2 ) preemptive async. act. EDF, LST, O(n 2 ) modified EDF, O(n 2 ) nonpreemptive async. act. tree search, O(n n!) heuristic search

Summary aperiodic task scheduling (arbitrary arrival times) 1 processor, no resources precedence constraints: yes/no preemption: yes/no performance measure: maximum lateness algorithms: earliest deadline first (EDF), least slack time (LST), branch and bound, latest deadline first (LDF), transformations