Reference model of real-time systems

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

Q1. What is Real time system? Explain the basic model of Real time system. (8)

Real-Time Systems. Modeling Real-Time Systems

A Reference Model of Real-Time Systems

Lecture 6: Scheduling. Michael O Boyle Embedded Software

Real-Time and Embedded Systems (M) Lecture 4

Introduction to Real-Time Systems. Note: Slides are adopted from Lui Sha and Marco Caccamo

Lecture 11: Scheduling

Real Time Scheduling. Real Time Scheduling. Real-Time Scheduling. Scheduling

ELC 4438: Embedded System Design Real-Time Scheduling

Scheduling theory, part 1

Clock-Driven Scheduling

MAX PLANCK INSTITUTE FOR SOFTWARE SYSTEMS. Max Planck Institute for Software Systems (MPI-SWS) Germany

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

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

Course Outline. Embedded Real Time Operating System Chin Fu Kuo National University of Kaohsiung 2009 Fall

Lab: Response Time Analysis using FpsCalc Course: Real-Time Systems Period: Autumn 2015

Clock-Driven Scheduling

Tasks or processes attempt to control or react to external events occuring in real time RT processes must be able to keep up events

DEADLINE MONOTONIC ALGORITHM (DMA)

Fixed-Priority scheduling! of! dual-criticality systems! Sanjoy Baruah and Alan Burns

2. Scheduling issues. Common approaches /2. Common approaches /1. Common approaches / /18 UniPD - T. Vardanega 14/03/2018

CHAPTER 4 CONTENT October :10 PM

GENERALIZED TASK SCHEDULER

Scheduling issues in mixedcriticality

Adaptive Total Bandwidth Server: Using Predictive Execution Time

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

Periodic task scheduling

CPU Scheduling (Chapters 7-11)

ENGG4420 CHAPTER 4 LECTURE 3 GENERALIZED TASK SCHEDULER

Limited-preemptive Earliest Deadline First Scheduling of Real-time Tasks on Multiprocessors

Dual Priority Algorithm to Schedule Real-Time Tasks in a Shared Memory Multiprocessor

Lecture: Scheduling. Nicole Megow

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

Graph Optimization Algorithms for Sun Grid Engine. Lev Markov

1

Real-time System Overheads: a Literature Overview

Learning Module II: Real-Time Systems Design

Design and Implementation of LST Based Dynamic Scheduler on Real Time OS

Dual Priority Scheduling: A Means of Providing Flexibility in Hard Real-time Systems.

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

Project 2 solution code

SE350: Operating Systems. Lecture 6: Scheduling

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

CPU scheduling. CPU Scheduling

Rate Monotonic Analysis

CS 111. Operating Systems Peter Reiher

Slack Assessment of the Real Time Scheduling Algorithms

Classification of Real-Time Systems

DEADLINE SCHEDULING FOR REAL-TIME SYSTEMS. EDF and Related Algorithms

Controlling Energy Profile of RT Multiprocessor Systems by Anticipating Workload at Runtime

CS 143A - Principles of Operating Systems

Schedulability Test for Soft Real-Time Systems under Multi- processor Environment by using an Earliest Deadline First Scheduling Algorithm Abstract

A Three-Step Approach For Low Power Scheduling Of Real- Time Embedded Systems

Limited Preemptive Real-time Scheduling on Multiprocessors. Abhilash Thekkilakattil

Preemptive Scheduling of Multi-Criticality Systems with Varying Degrees of Execution Time Assurance

September 30 th, 2015 Prof. John Kubiatowicz

Preference-Oriented Fixed-Priority Scheduling for Real-Time Systems

Adaptive Communication Scheduling

CSC 553 Operating Systems

Energy Efficient Fixed-Priority Scheduling for Real-Time Systems on Variable Voltage Processors

Real-Time Scheduling Theory and Ada

Operating Systems. Scheduling

Mwave/OS: A Predictable Real-time DSP Operating System

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

comp 180 Lecture 04 Outline of Lecture 1. The Role of Computer Performance 2. Measuring Performance

CS510 Operating System Foundations. Jonathan Walpole

Real time scheduling for embedded systems

Mode Change Protocols for Priority-Driven Preemptive Scheduling

UNIVERSITY OF OKLAHOMA GRADUATE COLLEGE

CSE 451: Operating Systems Spring Module 8 Scheduling

Performance Comparison of RTS Scheduling Algorithms

Schedulability Analysis of the Linux Push and Pull Scheduler with Arbitrary Processor Affinities

Integrated Control and Scheduling

Reading Reference: Textbook: Chapter 7. UNIX PROCESS SCHEDULING Tanzir Ahmed CSCE 313 Fall 2018

Implementing a Predictable Real-Time. Multiprocessor Kernel { The Spring Kernel.

Platform-Based Design of Heterogeneous Embedded Systems

Exploiting Dynamic Workload Variation in Low Energy Preemptive Task Scheduling

Platform-Based Design of Heterogeneous Embedded Systems

Association for Computing Machinery (ACM)

Recall: Example of RR with Time Quantum = 20. Round-Robin Discussion

Bounding Worst-Case Response Time for Tasks With Non-Preemptive Regions

Improving Throughput and Utilization in Parallel Machines Through Concurrent Gang

Lecture 11: CPU Scheduling

Chapter 3: Planning and Scheduling Lesson Plan

Process Scheduling I. COMS W4118 Prof. Kaustubh R. Joshi hdp://

Implementation and Evaluation of Multi-Mode Real-Time Tasks under Different Scheduling Algorithms

Asymptotic Analysis of Real-Time Queues

APPENDIX 1 Processing time (pij) Release date (rj) Due date (dj): Weight (wj)

Swift mode changes in memory constrained real-time systems

Co-scheduling Real-time Tasks and Non Real-time Tasks Using Empirical Probability Distribution of Execution Time Requirements.

Enhancement in System Schedulability by Controlling Task Releases

The BEST Desktop Soft Real-Time Scheduler

Multi-core Management A new Approach

CPU SCHEDULING. Scheduling Objectives. Outline. Basic Concepts. Enforcement of fairness in allocating resources to processes

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

Operations and Supply Chain Management Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

EEE499 - Real-Time Embedded System Design. Real-Time Schedulability Part I

FIFO SJF STCF RR. Operating Systems. Minati De. Department of Mathematics, Indian Institute of Technology Delhi, India. Lecture 6: Scheduling

Real-Time Scheduler Design For Embedded System Domain

Transcription:

Reference model of real-time systems Chapter 3 of Liu Michal Sojka Czech Technical University in Prague, Faculty of Electrical Engineering, Department of Control Engineering November 8, 2017 Some slides are derived from lectures by Steve Goddard and James H. Anderson 1 / 28

Reference model of RT systems In order to analyze a RT system/application, it is necessary to create its model. Main parts of RT system models Workload model describes the applications in the system. Resource model describes available system resources. Algorithms that define how the system resources are used. 2 / 28

Outline 1 Workload model 2 Resource model 3 Algorithms 4 Summary 3 / 28

Job and task description r ij R ij D ij C i Task τ i Job J ij d ij Job J ij+1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Time = release time (r ij ); the job is released at time 3. = absolute deadline (d ij ); the job has to be completed before deadline; equal to 10 for this case. Relative deadline (D ij ) is 7. Response time (R ij ) is 6. 4 / 28

Terminology detail Task τ i : A set of jobs executed in order to perform certain function in the system, e.g. airplane stabilization. Job J ij : An instance of task. Jobs need resources. Examples of resources: CPU, network, critical section, shovel Resources that can perform some work are called processors. Release time r ij : Time instant when a job is ready to be executed. Deadline d ij : Time instant by which the job has to be finished. Relative deadline D i : Difference between deadline and release time. Response time R ij : Completion time minus release time. Execution (computation) time C ij : Time needed to execute a job if runs alone on a processor. Feasible interval of a job: Interval between r ij and d ij. 5 / 28

Hard Real-Time Systems Hard Deadline is a deadline that has to be met under all circumstances. If a hard deadline is missed, the behavior of the system is wrong and it often has catastrophic consequences. We need mathematical apparatus for verifying that deadlines are met. But: There is nothing like a hard deadline in the real world. Hard Real-Time System: is a real-time system, where all deadlines are hard. This course is focused on hard real-time systems. They are easier to analyze. Why? Examples: Nuclear power plant, aircraft control. 6 / 28

Soft Real-Time Systems Soft Deadline (required completion time) can be missed occasionally. Question: How to define the term occasionally? Soft Real-Time System: a real-time system where all deadlines are soft. Example: Multimedia applications, telephone exchanges (but what about emergency calls?). 7 / 28

Reference model of RT systems Each job J i is characterized by its timing parameters, functional parameters, resource describing parameters and dependencies between individual jobs. Each job J i has its release time r i, deadline d i, relative deadline D i, computation time C i (often called execution time or worst-case execution time, WCET). Occasionally, some parameters are defined as ranges. E.g r i r i, r + i. The size of the interval is called release-time jitter. Similarly, execution time can be given as interval C i, C + i. Determination of exact value of C i might be difficult. Why? 8 / 28

Periodic, sporadic and aperiodic task models Periodic task model deterministic workload model, well suited for many hard real-time applications. Periodic task: Each task τ i has its period T i. Task τ i is composed of sequence of jobs. T i is minimal inter-arrival time between consecutive jobs. Task computation time is the maximum computation time among all jobs of τ i. Sporadic and aperiodic tasks released at arbitrary times. Sporadic tasks have hard deadlines. Aperiodic tasks have no or soft deadlines. 9 / 28

Liu vs. rest of the world Beware! What Liu calls periodic the rest of the world calls sporadic. For others period T i of task τ i means exact time between activations of two consecutively released jobs. 10 / 28

Examples Periodic task τ i with r i = 2, T i = 5, C i = 2, D i = 5 can be executed like this (continues until infinity). 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Legend: = job release time, = deadline. čas According to Liu, this task can execute, for example, like this: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 The rest of the world calls this sporadic task. čas 11 / 28

Some definitions for periodic task systems Number of tasks is n. The jobs of task τ i are denoted J i,1, J i,2, Φ i = r i,1 (release time of J i,1 ) is called the phase τ i. Synchronous system: Each task has phase of 0. Asynchronous system: Phases are arbitrary. What is more common? Hyperperiod: Least common multiple of {T 1,, T n }. Task utilization: u i = C i. T i System utilization: U = i=1,...,n u i 12 / 28

Task/job dependencies Data flow and control dependencies between the jobs can constrain the order in which the jobs can be executed. Two main types of dependencies: Mutual exclusion (critical sections) Precedence constraints e.g.: Job J i can start only after another job J k finishes. Tasks without any dependency on other tasks are called independent. In the initial lectures, we will only consider independent tasks. Software tasks running under a (RT)OS are rarely independent. 13 / 28

Job dependencies Precedence relation on a set of jobs is a relation, that determines precedence constrains among individual jobs. Job J i is a predecessor of another job J k (and J k is successor of job J i ), if J k cannot be started before J i is finished. A job with predecessor is ready to be executed, when current time is greater than its release time and all its predecessors are completed. 14 / 28

Task graph Precedence graph directed graph G = (J, <), where each node represents a job from set J and if job J i is immediate predecessor of J k (relation <), there is a directed edge from node J i to node J k. Data dependencies cannot be captured in the precedence graph. Task graph is an extended precedence graph. It can contain other types of dependencies. Type of an edge connecting two nodes and other parameters of the edge is called interconnection parameters of the jobs. Data dependencies are represented explicitly by data-dependency edges. An interconnection parameter can be, for example, the amount of data passed between the jobs. Task graphs are rarely used periodic-task systems. 15 / 28

Task graph example (0, 6] (2, 9] (4, 11] (6, 13] (8, 15] (2, 5] (5, 8] (8, 11] (11, 14] (13, 17] (0, 5] (4, 8] (5, 20] branch (0, 6] J conditional block join (2, 10] 2/3 1/2 Numbers above a job give its feasible interval. 16 / 28

Other types of dependencies Time dependency (distance) is difference of job completion times. AND/OR precedence constraints dependence among immediate job predecessors. AND job node J OR jobs square nodes marked 2/3 a 1/2. Conditional branches represent conditional execution of jobs. Branch is a job represented by filled circles. Conditional block subgraph starting in a branch node and ending at next join job. Pipe relation is dependency among a pair of jobs that are in produce-consumer relation (dotted hrana). 17 / 28

Functional parameters Preemptivity of jobs Preemptive Non-preemptive Criticality of jobs Optional execution Laxity type and laxity function 18 / 28

Resource model Outline 1 Workload model 2 Resource model 3 Algorithms 4 Summary 19 / 28

Resource model Terminology Processors P i (active resources) execute machine instructions, move data, read files etc. (CPU, communication links, disks, database servers) Resources R i (passive resources) additional resources needed by jobs to perform their task (memory, mutexes, semaphores). By resources we usually understand reusable resources. Non-reusable resource is, for example, Energy (power-aware scheduling). 20 / 28

Resource model Resource parameters Processors Speed of a processor Topology of CPU interconnect/network-on-chip Preemptivity of resources (CPU, network, ) Memory hierarchy (caches, DRAMs, ) Resource graph Wake-up delay from power-saving state 21 / 28

Algorithms Outline 1 Workload model 2 Resource model 3 Algorithms 4 Summary 22 / 28

Algorithms Scheduling algorithms We are interested in two types of algorithms: 1 Scheduling algorithm, which produces the schedule of jobs (maybe at runtime). In real-time systems, this algorithm is usually simple. 2 Schedulability analysis algorithm, which verifies whether all timing constraints are met. This algorithm is typically more complex. 23 / 28

Algorithms Classification of scheduling algorithms (used in real-time systems) Scheduling algorithms Off-line scheduling (static, clock-driven) On-line scheduling (dynamic) Static-priority scheduling (VxWorks, SCHED_FIFO) Deadline-driven scheduling (EDF, ) General purpose OS scheduling (fair, interactive, ) 24 / 28

Algorithms Feasibility and optimality A valid schedule is a feasible schedule if every job completes by its deadline (or, in general, meets its timing constraints). A set of jobs τ is schedulable according to scheduling algorithm A if when using the algorithm scheduler always produces a feasible schedule for τ. Hard real-time scheduling algorithm is optimal if the algorithm always produces a feasible schedule if the given set of jobs has feasible schedules. Similarly, we can define optimality for a class of schedulers e.g.. optimal scheduler for static priorities. 25 / 28

Summary Outline 1 Workload model 2 Resource model 3 Algorithms 4 Summary 26 / 28

Summary Model of a real-time system Comprises of the following parts: 1 Workload model Set of tasks/jobs and their parameters (C i, D i, resource dependencies, ) Precedence graph or task graph etc. 2 Resource model Description of resources (CPU, memory, network, etc.), their types and relations among them. Often: resource model is just Uni-processor. 3 Algorithms Fixed-priority scheduler + priority inheritance Off-line scheduler 27 / 28

Summary Real-Time system model example 28 / 28