Periodic Task Scheduling



Similar documents
4. Fixed-Priority Scheduling

Scheduling Aperiodic and Sporadic Jobs in Priority- Driven Systems

Real Time Scheduling Basic Concepts. Radek Pelánek

Priority-Driven Scheduling

3. Scheduling issues. Common approaches /1. Common approaches /2. Common approaches / /13 UniPD / T. Vardanega 23/01/2013. Real-Time Systems 1

Lecture 3 Theoretical Foundations of RTOS

Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1

Common Approaches to Real-Time Scheduling

Real-Time Scheduling (Part 1) (Working Draft) Real-Time System Example

Predictable response times in event-driven real-time systems

The simple case: Cyclic execution

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

Real- Time Scheduling

Aperiodic Task Scheduling

Aperiodic Task Scheduling

Real-Time Software. Basic Scheduling and Response-Time Analysis. René Rydhof Hansen. 21. september 2010

Operating System Aspects. Real-Time Systems. Resource Management Tasks

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

Resource Reservation & Resource Servers. Problems to solve

174: Scheduling Systems. Emil Michta University of Zielona Gora, Zielona Gora, Poland 1 TIMING ANALYSIS IN NETWORKED MEASUREMENT CONTROL SYSTEMS

Real-time scheduling algorithms, task visualization

Commonly Used Approaches to Real-Time Scheduling

Scheduling Real-time Tasks: Algorithms and Complexity

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

Partition Scheduling in APEX Runtime Environment for Embedded Avionics Software

REAL TIME OPERATING SYSTEMS. Lesson-18:

Performance of Algorithms for Scheduling Real-Time Systems with Overrun and Overload

Improved Handling of Soft Aperiodic Tasks in Offline Scheduled Real-Time Systems using Total Bandwidth Server

CPU Scheduling. Multitasking operating systems come in two flavours: cooperative multitasking and preemptive multitasking.

Real-Time Scheduling 1 / 39

HARD REAL-TIME SCHEDULING: THE DEADLINE-MONOTONIC APPROACH 1. Department of Computer Science, University of York, York, YO1 5DD, England.

Lec. 7: Real-Time Scheduling

CPU Scheduling. CPU Scheduling

Effective Scheduling Algorithm and Scheduler Implementation for use with Time-Triggered Co-operative Architecture

Multi-core real-time scheduling

A Survey of Fitting Device-Driver Implementations into Real-Time Theoretical Schedulability Analysis

ICS Principles of Operating Systems

N. Audsley. A. Burns Department of Computer Science, University of York, UK. ABSTRACT

LAB 5: Scheduling Algorithms for Embedded Systems

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Exercises : Real-time Scheduling analysis

CPU Scheduling. Core Definitions

An Efficient Non-Preemptive Real-Time Scheduling

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

Today. Intro to real-time scheduling Cyclic executives. Scheduling tables Frames Frame size constraints. Non-independent tasks Pros and cons

Integrating job parallelism in real-time scheduling theory

Least Slack Time Rate First: an Efficient Scheduling Algorithm for Pervasive Computing Environment

Modular Real-Time Linux

AN APPROPRIATE ENGINEERING APPROACH

Real-Time Multi-Core Virtual Machine Scheduling in Xen

Task Attribute-Based Scheduling - Extending Ada s Support for Scheduling

Scheduling Sporadic Tasks with Shared Resources in Hard-Real-Time Systems

SOFTWARE VERIFICATION RESEARCH CENTRE THE UNIVERSITY OF QUEENSLAND. Queensland 4072 Australia TECHNICAL REPORT. No Real-Time Scheduling Theory

Today s topic: So far, we have talked about. Question. Task models

/ Operating Systems I. Process Scheduling. Warren R. Carithers Rob Duncan

Using EDF in Linux: SCHED DEADLINE. Luca Abeni

Operating Systems. III. Scheduling.

Aperiodic Task Scheduling for Real-Time Systems. Brinkley Sprunt

Quality of Service su Linux: Passato Presente e Futuro

Real-Time Scheduling and Threads: Basics

Global Multiprocessor Real-Time Scheduling as a Constraint Satisfaction Problem

Scheduling of Real- Time processes, strategies and analysis

Operatin g Systems: Internals and Design Principle s. Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings

W4118 Operating Systems. Instructor: Junfeng Yang

The Trip Scheduling Problem

CHAPTER 4: SOFTWARE PART OF RTOS, THE SCHEDULER

Scheduling Single Machine Scheduling. Tim Nieberg

Hierarchical Real-Time Scheduling and Synchronization

RUN: Optimal Multiprocessor Real-Time Scheduling via Reduction to Uniprocessor

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems

An improved on-line algorithm for scheduling on two unrestrictive parallel batch processing machines

Advanced Operating Systems (M) Dr Colin Perkins School of Computing Science University of Glasgow

The Design and Implementation of Real-Time Schedulers in RED-Linux

Offline sorting buffers on Line

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

How To Compare Real Time Scheduling To A Scheduled Scheduler On Linux On A Computer System With A Visualization System

Sustainability in Real-time Scheduling

Real Time Scheduling Theory: A Historical Perspective

OPERATING SYSTEMS SCHEDULING

Real-Time Multi-Core Virtual Machine Scheduling in Xen

Enhancing the Monitoring of Real-Time Performance in Linux

Introduction. Scheduling. Types of scheduling. The basics

Embedded Systems 20 BF - ES

Real-Time Scheduling Strategy for Wireless Sensor Networks O.S

Embedded Systems 20 REVIEW. Multiprocessor Scheduling

Fault tolerant scheduling on a hard real time multiprocessor system. S. Ghosh, Rami Melhem, Daniel Mosse

Process Scheduling. Process Scheduler. Chapter 7. Context Switch. Scheduler. Selection Strategies

HIGH PRECISION AUTOMATIC SCHEDULING OF TASK SETS FOR MICROCONTROLLERS. Benjamin Ness. Thesis. Submitted to the Faculty of the

Chapter 5 Process Scheduling

Scheduling. Monday, November 22, 2004

Embedded Software Architecture

Factoring & Primality

On-line scheduling algorithm for real-time multiprocessor systems with ACO

Scheduling of the Distributed Thread Abstraction with Timing Constraints using RTSJ

Time Management II. June 5, Copyright 2008, Jason Paul Kazarian. All rights reserved.

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

Implementing and Using Execution Time Clocks in Ada Hard Real-Time Applications

Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5

Efficient Scheduling Of On-line Services in Cloud Computing Based on Task Migration

Processor Scheduling. Queues Recall OS maintains various queues

Transcription:

Periodic Task Scheduling Radek Pelánek

Motivation and Assumptions Examples of Periodic Tasks sensory data acquisition control loops action planning system monitoring

Motivation and Assumptions Simplifying Assumptions constant period T i all instances (jobs) of a task have the same computation time C i no precedence relations, no resources preemption (deadline is equal to period D i = T i ) (no aperiodic jobs)

Motivation and Assumptions Example τ 1 τ 2 τ 3 C i 2 4 3 T i 6 10 12 find schedule think about possible scheduling algorithms

Motivation and Assumptions Outlook notions: jitter, processor utilization, schedulable utilization three basic approaches: static scheduling, dynamic priorities (EDF), fixed priorities (rate monotonic) examples discussion

Motivation and Assumptions Jitter deviation of the start/finishing time of consecutive instances of some task relative, absolute jitter for some applications it is important to minimize the jitter we do not deal with this issue in detail

Processor Utilization Factor Processor Utilization Factor Definition (Processor utilization factor) Given a set Γ of n periodic tasks, processor utilization factor U is the fraction of processor time spent in the execution of the task set: U = Σ n C i i=1 T i Example: U = 2 6 + 4 10 + 3 12 = 59 60 Note: U > 1 not schedulable

Processor Utilization Factor Schedulable Utilization Definition (Schedulable Utilization) schedulable utilization U S of a scheduling algorithm the algorithm can feasibly schedule any set of periodic tasks o with the total utilization of the tasks is U S used to easily verify the schedulability of a task set

Cyclic Scheduling Cyclic Scheduling an approach, rather than algorithm (timeline scheduling, clock-driven scheduling) static schedule, constructed off-line schedule specifies exactly when each job executes minor cycle = greatest common divisor of periods major cycle = time after which the schedule repeats itself

Cyclic Scheduling Example T A = 25, T B = 50, T C = 100

Cyclic Scheduling Aperiodic Jobs spare capacities in the static schedule can be used for handling aperiodic jobs aperiodic jobs can be scheduled e.g. by deadline based algorithm

Cyclic Scheduling Advantages and Disadvantages advantages: simple, efficient (precomputed) can deal with complex requirements, precedence constraints,... special requirements can be taken into account (e.g., minimizing jitter or context switches) disadvantages: inflexible, difficult to modify and maintain fragile (overrun may cause whole schedule to fail) not very suitable for systems with both periodic and aperiodic tasks Suitable for systems which are rarely modified once built (e.g., small embedded controllers).

Earliest Deadline First Earliest Deadline First dynamic priority assignment selects tasks according to absolute deadline does not depend on periodicity; can be directly used for periodic+aperiodic tasks

Earliest Deadline First Schedulability Analysis Schedulable utilization of EDF is 1. Theorem A set of periodic tasks is schedulable with EDF if and only if Σ n i=1 C i T i 1

Earliest Deadline First Extensions deadlines less than periods, aperiodic jobs the algorithm works directly for both extensions schedulability analysis is more complex (not covered)

Rate Monotonic Rate Monotonic Scheduling priority based algorithm: tasks scheduled according to priorities fixed-priority assignment: priorities assigned before the execution (all jobs of one task have the same priority) priorities according to periods: shorter period - higher priority preemptive

Rate Monotonic Example τ 1 τ 2 τ 3 C i 2 4 3 T i 6 10 12

Rate Monotonic Optimality in general RM is not optimal RM is optimal among fixed-priority algorithms Theorem If a task set can be scheduled by fixed-priority algorithm then it can be scheduled by Rate Monotonic algorithm.

Rate Monotonic Schedulable Utilization For arbitrary set of periodic tasks, the schedulable utilization of the RM scheduling algorithm is U S = n(2 1/n 1) n 1 2 3 4 5 U S 1.00 0.82 0.78 0.76 0.74 For high values of n the schedulable utilization converges to U lub = ln 2 0.69

Rate Monotonic Optimality for Simply Periodic Tasks a set of periodic tasks is simply periodic if for every pair of tasks: T i < T j T j is an integer multiple of T i Theorem A system of simply periodic tasks is schedulable according to the RM algorithm if and only if its utilization factor is 1.

Rate Monotonic Deadline Monotonic deadlines less than period priorities assigned according to inverse of relative deadlines

Examples and Comparison Example τ 1 τ 2 C i 2 4 T i 5 7 What is the utilization factor? Is the task set schedulable? What is the schedule produced by EDF/RM?

Examples and Comparison Example U = 2 5 + 4 7 = 34 35 0.97

Examples and Comparison Example 2 τ 1 τ 2 τ 3 C i 2 2 2 T i 6 8 12 What is the utilization factor? Is the task set schedulable? What is the schedule produced by RM?

Examples and Comparison Example 3 τ 1 τ 2 τ 3 C i 1 2 3 T i 4 6 8 What is the utilization factor? Is the task set schedulable? What is the schedule produced by RM/EDF?

Examples and Comparison Comparison: RM vs EDF RM EDF implementation multi-level priority heap, O(log n) queue, O(1) processor utilization guarantee only for 0.69, full utilization practice 0.88 context switches many few guarantee test nontrivial simple predictability good bad in practice: fixed-priority schedulers

Examples and Comparison Note on Predictability overload condition (processor utilization factor > 1), which tasks will not meet deadlines? EDF unpredictable RM predictable (tasks with the longest period) reminder: Apollo 11 landing processor overload RM algorithm used predictable behaviour decision possible

Aperiodic Jobs in Priority-driven Systems real systems combination of periodic and aperiodic tasks main approaches: fixed priority servers: scheduling of periodic tasks done by fixed priority algorithm (typically RM) dynamic priority servers: scheduling of periodic tasks done by dynamic priority algorithm (typically EDF)

Assumptions and Remarks periodic tasks scheduled by a fixed priority algorithm (specifically rate monotonic) all periodic tasks start simultaneously at time t = 0, deadline = period arrival times of aperiodic tasks are unknown beforehand preemption goal: meet deadlines of periodic tasks, minimize response time of aperiodic tasks ordering of aperiodic tasks not discussed (done by some aperiodic scheduling algorithm, we will use FIFO)

Example Periodic jobs: Aperiodic jobs: τ 1 τ 2 C i 1 2 T i 4 6 J 1 J 2 J 3 J 4 a i 2 8 12 19 C i 2 1 2 1

Background Scheduling Background Scheduling aperiodic tasks scheduled in background (when no periodic task is running) schedule of periodic tasks is not changed major problem: high periodic load poor response times for aperiodic tasks

Background Scheduling Example

Background Scheduling Realization

Polling Server Server for Aperiodic Tasks periodic task whose purpose is to service aperiodic requests period T S, computation time C S (capacity) scheduled in the same way as periodic tasks note: selection of T S, C S total utilization factor must remain 1

Polling Server Polling Server the simplest variant of server when active: serve pending aperiodic requests within its capacity no aperiodic requests are pending suspend

Polling Server Polling Server: Example

Polling Server Improving Polling Server how can we improve the performance? (consider the previous example)

Deferrable Server Deferrable Server similar to polling server if no aperiodic requests are pending: suspend itself preserve capacity until the end of the period if aperiodic request arrives later during the period: it is served at the beginning of the period capacity is fully replenished

Deferrable Server Deferrable Server: Example

Deferrable Server Deferrable Server: Properties deferrable server provides better responsiveness than polling server schedulability analysis more complicated defferable server is not equivalent to periodic task

Deferrable Server Deferrable Server: Example 2

Priority Exchange Priority Exchange periodic server with high priority preserves capacity by exchanging it for the execution time of a lower-priority task: at the beginning of the period: replenish the capacity aperiodic requests are pending: serve them no aperiodic requests are pending: exchange execution time with the active periodic task with the highest priority the priority exchange is performed repeatedly

Priority Exchange Example

Slack Stealing Slack Stealing no periodic server; passive task Slack Stealer slack = d i t c i (t) main idea: no benefit in early completion of periodic tasks when aperiodic request arrives: steal available slacks better responsiveness, more complicated schedulability analysis

Slack Stealing Example

Discussion Non-existence of Optimal Servers Theorem For any set of periodic tasks ordered on a given fixed-priority scheme and aperiodic requests ordered according to a given aperiodic queueing discipline, there does not exist any valid algorithm that minimizes the response time of every soft aperiodic request. Similarly for average response time.

Discussion Evaluation of Fixed Priority Servers

Discussion Example periodic tasks τ 1 τ 2 C i 1 2 T i 5 8 aperiodic tasks J 1 J 2 J 3 a i 2 7 17 C i 3 1 1 Create schedules and determine response times: background scheduling polling server with intermediate priority deferrable server with the highest priority

Discussion Summary of the Lecture scheduling periodic tasks cyclic scheduling (static schedule) rate monotonic scheduling (static priorities) earliest deadline first scheduling (dynamic priorities) processor utilization factor, schedulable utilization aperiodic tasks in periodic systems: fixed priority servers