Real-Time Calculus. LS 12, TU Dortmund

Similar documents
Temperature-Aware Analysis and Scheduling

Modeling Fixed Priority Non-Preemptive Scheduling with Real-Time Calculus

Component-based Analysis of Worst-case Temperatures

Scheduling Periodic Real-Time Tasks on Uniprocessor Systems. LS 12, TU Dortmund

Background Concrete Greedy Shapers Min-Plus Algebra Abstract Greedy Shapers Acknowledgment. Greedy Shaper

Different Scenarios of Concatenation at Aggregate Scheduling of Multiple Nodes

Cyclic Dependencies in Modular Performance Analysis

Embedded Systems 23 BF - ES

Cyclic Dependencies in Modular Performance Analysis

Multiprocessor Scheduling II: Global Scheduling. LS 12, TU Dortmund

Revisiting GPC and AND Connector in Real-Time Calculus

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

Multiprocessor Scheduling I: Partitioned Scheduling. LS 12, TU Dortmund

Schedulability of Periodic and Sporadic Task Sets on Uniprocessor Systems

Lecture 6. Real-Time Systems. Dynamic Priority Scheduling

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

Modeling Buffers With Data Refresh Semantics in Automotive Architectures

Andrew Morton University of Waterloo Canada

Modeling Buffers with Data Refresh Semantics in Automotive Architectures

Modeling Buffers with Data Refresh Semantics in Automotive Architectures

CycleTandem: Energy-Saving Scheduling for Real-Time Systems with Hardware Accelerators

A Framework for Automated Competitive Analysis of On-line Scheduling of Firm-Deadline Tasks

Networked Embedded Systems WS 2016/17

Schedulability and Optimization Analysis for Non-Preemptive Static Priority Scheduling Based on Task Utilization and Blocking Factors

Aperiodic Task Scheduling

CEC 450 Real-Time Systems

Real-Time Scheduling and Resource Management

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

Static priority scheduling

IN4343 Real Time Systems April 9th 2014, from 9:00 to 12:00

Embedded Systems 14. Overview of embedded systems design

A Demand Response Calculus with Perfect Batteries

Real-Time Workload Models with Efficient Analysis

A Calculus for End-to-end Statistical Service Guarantees

Network management and QoS provisioning - Network Calculus

Worst-Case Execution Time Analysis. LS 12, TU Dortmund

Schedulability analysis of global Deadline-Monotonic scheduling

Module 5: CPU Scheduling

Design of Real-Time Software

1. Supremum and Infimum Remark: In this sections, all the subsets of R are assumed to be nonempty.

Quantifying the Effect of Rare Timing Events with Settling-Time and Overshoot

Mixed Criticality in Safety-Critical Systems. LS 12, TU Dortmund

Lecture: Workload Models (Advanced Topic)

Chapter 6: CPU Scheduling

Paper Presentation. Amo Guangmo Tong. University of Taxes at Dallas February 11, 2014

A Note on Modeling Self-Suspending Time as Blocking Time in Real-Time Systems

Embedded Systems 15. REVIEW: Aperiodic scheduling. C i J i 0 a i s i f i d i

Leveraging Transactional Memory for a Predictable Execution of Applications Composed of Hard Real-Time and Best-Effort Tasks

Non-Work-Conserving Non-Preemptive Scheduling: Motivations, Challenges, and Potential Solutions

Worst-Case Execution Time Analysis. LS 12, TU Dortmund

arxiv: v1 [cs.os] 28 Feb 2018

Real-Time and Embedded Systems (M) Lecture 5

CPU SCHEDULING RONG ZHENG

Recent Progress on a Statistical Network Calculus

UNIVERSITY OF CALIFORNIA, SAN DIEGO. Quality of Service Guarantees for FIFO Queues with Constrained Inputs

On-line scheduling of periodic tasks in RT OS

A Mechanism for Pricing Service Guarantees

Control Hierarchies and Tropical Algebras

MATH202 Introduction to Analysis (2007 Fall and 2008 Spring) Tutorial Note #7

EDF Feasibility and Hardware Accelerators

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

Structure of R. Chapter Algebraic and Order Properties of R

Worst-case response time analysis of real-time tasks under fixed-priority scheduling with deferred preemption revisited

Real-Time Systems. LS 12, TU Dortmund

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

Embedded Systems Design: Optimization Challenges. Paul Pop Embedded Systems Lab (ESLAB) Linköping University, Sweden

EDF Scheduling. Giuseppe Lipari May 11, Scuola Superiore Sant Anna Pisa

On the Impact of Link Scheduling on End-to-End Delays in Large Networks

MATH 102 INTRODUCTION TO MATHEMATICAL ANALYSIS. 1. Some Fundamentals

Worst Case Burstiness Increase due to FIFO Multiplexing

Exam Spring Embedded Systems. Prof. L. Thiele

EDF Scheduling. Giuseppe Lipari CRIStAL - Université de Lille 1. October 4, 2015

Real-Time Systems. Event-Driven Scheduling

Real-Time Systems. Event-Driven Scheduling

Network Calculus Analysis of Feedback Systems with Random Service. Alireza Shekaramiz

Converting existing analysis to the EDP resource model

Paper Presentation. Amo Guangmo Tong. University of Taxes at Dallas January 24, 2014

Power Systems Control Prof. Wonhee Kim. Modeling in the Frequency and Time Domains

Lecture Notes in Computer Science Edited by G. Goos, J. Hartmanis and J. van Leeuwen

Time and Schedulability Analysis of Stateflow Models

CMSC 451: Lecture 7 Greedy Algorithms for Scheduling Tuesday, Sep 19, 2017

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

Compositional Analysis Techniques For Multiprocessor Soft Real-Time Scheduling

Load Regulating Algorithm for Static-Priority Task Scheduling on Multiprocessors

How to deal with uncertainties and dynamicity?

This exam contains 5 pages (including this cover page) and 4 questions. The total number of points is 100. Grade Table

Cool Shapers: Shaping Real-Time Tasks for Improved Thermal Guarantees

1 Introduction Future high speed digital networks aim to serve integrated trac, such as voice, video, fax, and so forth. To control interaction among

arxiv: v3 [cs.ds] 23 Sep 2016

Design of Real-Time Software

Economics 204 Summer/Fall 2011 Lecture 2 Tuesday July 26, 2011 N Now, on the main diagonal, change all the 0s to 1s and vice versa:

More Approximation Algorithms

A Network Calculus with Effective Bandwidth

Shedding the Shackles of Time-Division Multiplexing

There are three priority driven approaches that we will look at

2.1 Task and Scheduling Model. 2.2 Definitions and Schedulability Guarantees

Efficient TDM-based Arbitration for Mixed-Criticality Systems on Multi-Cores

Econ Lecture 2. Outline

Rate Monotonic Analysis (RMA)

Deadline-driven scheduling

Transcription:

Real-Time Calculus Prof. Dr. Jian-Jia Chen LS 12, TU Dortmund 09, Dec., 2014 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 1 / 35

Arbitrary Deadlines The worst-case response time of τ i by only considering the first job of τ i at the critical instant is too optimistic when the relative deadline of τ i is larger than the period. 0 100 200 300 400 500 600 700 0 100 200 300 400 500 600 700 Consider two tasks: τ 1 has period 70 and execution time 26 and τ 2 is with period 100 and execution time 62. τ 2 s seven jobs have the following response times, respectively: 114, 102, 116, 104, 118, 106, 94. Note that the first job s response time is not the longest. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 2 / 35

Busy Intervals Definition A τ i -level busy interval (t 0, t] of task τ i begins at an instant t 0 when 1 all jobs in τ i released before t have completed, and 2 a job of τ i releases. The interval ends at the first instant t after t0 when all jobs in τ i released since t 0 are complete. τ 2 τ i t0 busy interval t Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 3 / 35

Abstract Models for Real-Time Calculus Processor Input Stream Tasks Concrete Instance Abstract Representation Service Model Load Model Processing Model Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 4 / 35

Abstract Models for Module Performance Analysis Input Stream CPU BUS DSP Concrete Instance RM TDMA Abstract Representation α β CP U β BUS β DSP TDMA GPC GPC GPC α GPC GPC Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 5 / 35

Overview System View Math. View Module Performance Analysis (MPA) Real-Time Calculus (RTC) Min-Plus Calculus, Max-Plus Calculus Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 6 / 35

Backgrounds Real-Time Calculus can be regarded as a worst-case/best-case variant of classical queuing theory. It is a formal method for the analysis of distributed real-time embedded systems. Related Work: Min-Plus Algebra: F. Baccelli, G. Cohen, G. J. Olster, and J. P. Quadrat, Synchronization and Linearity An Algebra for Discrete Event Systems, Wiley, New York, 1992. Network Calculus: J.-Y. Le Boudec and P. Thiran, Network Calculus -A Theory of Deterministic Queuing Systems for the Internet, Lecture Notes in Computer Science, vol. 2050, Springer Verlag, 2001. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 7 / 35

Plus-Times and Min-Plus Algebras Algebraic structure a set of (finite or infinite) elements S one or more operators defined on the elements of this set Plus-Times Algebra: Two operators + and, denoted by (S, +, ) Min-Plus Algebra Two operators (min) and (plus), denoted by (S {+ }, inf, +) Infimum: The infimum of a subset of some set is the greatest element, not necessarily in the subset, that is less than or equal to all other elements of the subset. For example, inf{[a, b]} = a, inf{(a, b]} = a, where min{[a, b]} = a, min{(a, b]} = undefined. Supremum: The supremum of a subset of some set is the smallest element, not necessarily in the subset, that is more than or equal to all other elements of the subset. For example, sup{[a, b]} = b, sup{[a, b)} = b, where max{[a, b]} = b, max{[a, b)} = undefined. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 8 / 35

Definition of Arrival Curves and Service Curves For a specific trace: Data streams: R(t) = number of events in [0, t) Resource stream: C(t) = available resource in [0, t) For the worst cases and the best cases in any interval with length : Arrival Curve [α l, α u ]: α l ( ) = α u ( ) = Service Curve [β l, β u ]: β l ( ) = β u ( ) = inf {R( + λ) R(λ)} λ 0, R sup {R( + λ) R(λ)} λ 0, R inf {C( + λ) C(λ)} λ 0, C sup {C( + λ) C(λ)} λ 0, C Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 9 / 35

Abstract Models for Real-Time Calculus Processor C(t) Input Stream R(t) Tasks R (t) Concrete Instance Abstract Representation Service Model Load Model α( ) β( ) Processing Model Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 10 / 35

Arrival Curve: An Example Use a sliding window to get the upper bound of the number of events in a specified interval length. 0 2 4 6 8 10 12 14 time Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 11 / 35

Arrival Curve: An Example Use a sliding window to get the upper bound of the number of events in a specified interval length. 0 2 4 6 8 10 12 14 time Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 11 / 35

Arrival Curve: An Example Use a sliding window to get the upper bound of the number of events in a specified interval length. 0 2 4 6 8 10 12 14 time Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 11 / 35

Arrival Curve: An Example Use a sliding window to get the upper bound of the number of events in a specified interval length. 0 2 4 6 8 10 12 14 time Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 11 / 35

Arrival Curve: An Example Use a sliding window to get the upper bound of the number of events in a specified interval length. 0 2 4 6 8 10 12 14 time Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 11 / 35

Arrival Curve: An Example Use a sliding window to get the upper bound of the number of events in a specified interval length. 0 2 4 6 8 10 12 14 time Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 11 / 35

Arrival Curve: An Example Use a sliding window to get the upper bound of the number of events in a specified interval length. 0 2 4 6 8 10 12 14 time workload maximum events in 3 units 0 2 4 6 8 10 12 time Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 11 / 35

Arrival Curve: An Example Use a sliding window to get the upper bound of the number of events in a specified interval length. 0 2 4 6 8 10 12 14 time workload maximum events in 3 units minimum events in 3 units 0 2 4 6 8 10 12 time Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 11 / 35

Arrival Curve: An Example Use a sliding window to get the upper bound of the number of events in a specified interval length. 0 2 4 6 8 10 12 14 time workload maximum events in 3 units possible events in 3 units minimum events in 3 units 0 2 4 6 8 10 12 time Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 11 / 35

Service Curve: An Example Resource Availability availability t 2.5 ms t (ms) Service Curves β = [β l, β u ] service β u β l 2.5 ms (ms) Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 12 / 35

Example 1: Periodic with Jitter A common event pattern that is used in literature can be specified by the parameter triple (p, j, d), where p denotes the period, j the jitter, and d the minimum inter-arrival distance of events in the modeled stream. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 35

Example 1: Periodic with Jitter Periodic Periodic with Jitter α u ( ) = p α l ( ) = p + j α u ( ) = p j α l ( ) = p Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 14 / 35

Example 1: Periodic with Jitter j α l ( ) = p { + j α u ( ) = min p, } d Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 15 / 35

More Examples on Arrival Curves 10 (a) 10 (b) 8 α u 8 α u # events 6 4 α l # events 6 4 α l 2 2 # events 0 0 10 20 30 10 8 6 4 2 (c) α u α l 0 0 10 20 30 # events 0 0 10 20 30 10 8 6 4 (d) α u 2 α l 0 0 10 20 30 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 16 / 35

Example 2: TDMA Resource Consider a real-time system consisting of n applications that are executed on a resource with bandwidth B that controls resource access using a TDMA (Time Division Multiple Access) policy. Analogously, we could consider a distributed system with n communicating nodes, that communicate via a shared bus with bandwidth B, with a bus arbitrator that implements a TDMA policy. TDMA policy: In every TDMA cycle of length c, one single resource slot of length s i is assigned to application i. app 1 app 2 app n app 1 app 2 app n app 1 app 2 app n c c c s n s n s n Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 17 / 35

Example 2: TDMA Resource { β u ( ) = B min c { β l ( ) = B max c s i, s i, c c } ( c s i ) } ( c s i ) Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 18 / 35

More Examples on Service Curves Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 19 / 35

On-Site Exercise Consider a stream of events. There are at most three events and at least 2 events arriving within a time interval [k p, (k + 1) p) for k = 0, 1, 2,.... These 2 or 3 events within a period p are defined as follows: At time k p, there is one event. At time k p + 0.3p, there is another event. Between time k p + 0.4p and k p + 0.5p, there may be one event. How do the upper and lower arrival curves look like? Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 20 / 35

Convolutions Plus-times system theory: signals f, impulse response g, convolution in time domain: h(t) = (f g)(t) = t 0 f (t s)g(s)ds, where f, g can be thought as signals and impulse response, respectively. Min-Plus system theory: streams R, variability curves g, convolution in time-interval domain: R (t) (R g)(t) = inf {R(t λ) + g(λ)}. 0 λ t Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 21 / 35

Abstraction Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 22 / 35

Convolution and De-convolution f g is called min-plus convolution (f g)(t) = inf {f (t λ) + g(λ)} 0 λ t f g is called min-plus de-convolution (f g)(t) = sup{f (t + λ) g(λ)} 0 λ f g is called max-plus convolution (f g)(t) = sup {f (t λ) + g(λ)} 0 λ t f g is called max-plus de-convolution (f g)(t) = inf {f (t + λ) g(λ)} 0 λ Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 23 / 35

Arrival and Service Curves Revisit α l (t s) R(t) R(s) α u (t s) s t. β l (t s) C(t) C(s) β u (t s) s t. Therefore, by using the convolution and de-convolution, we know that α u = R R; α l = R R; β u = C C; β l = C C; The proof for α u : α u ( ) = sup {R( + λ) R(λ)} R( + λ) R(λ), λ 0. λ 0 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 24 / 35

Tight Curves A curve f is sub-additive, if f (a) + f (b) f (a + b) a, b 0. The sub-additive closure f of a curve f is the largest sub-additive curve with f f and is computed as f = min{f, (f f ), (f f f ),...}. If f is interpreted as an arrival curve, then any trace R that is upper bounded by f is also upper bounded by the sub-additive closure f. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 25 / 35

Tight Curves A curve f is sub-additive, if f (a) + f (b) f (a + b) a, b 0. The sub-additive closure f of a curve f is the largest sub-additive curve with f f and is computed as f = min{f, (f f ), (f f f ),...}. If f is interpreted as an arrival curve, then any trace R that is upper bounded by f is also upper bounded by the sub-additive closure f. A tight upper arrival curve should satisfy the sub-additive property. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 25 / 35

Greedy Processing Component (GPC) Component is triggered by incoming events. A fully preemptable task is instantiated at every event arrival to process the incoming event. Active tasks are processed in a greedy fashion in FIFO order. Processing is restricted by the availability of resources. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 26 / 35

Some Relations (only for your reference) The output upper arrival curve of a component satisfies α u (α u β l ) with a simple and pessimistic calculation. The remaining lower service curve of a component satisfies β l ( ) = sup (β l (λ) α u (λ)) 0 λ Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 27 / 35

More Relations (only for your reference) [β l, β u ] α u = [(α u β u ) β l ] β u α l = [(α u β l ) β l ] β l β u = (β u α l ) 0 [α l, α u ] GPC [β l, β u ] [α l, α u ] β l = (β l α u ) 0 Without formal proofs... Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 28 / 35

Graphical Interpretation [β l, β u ] workload [α l, α u ] GPC [α l, α u ] Maximum buffer B [β l, β u ] Maximum response time D 0 2 4 6 8 10 12 time B = sup{r(t) R (t)} sup{α u (λ) β l (λ)} t 0 λ 0 D = sup{inf{τ 0 : R(t) R (t + τ)}} t 0 = sup{inf{τ 0 : α u ( ) β l ( + τ)}} 0 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 29 / 35

System Composition CPU BUS DSP Concrete Instance RM TDMA How to Interconnect service? Scheduling β CP U β BUS β DSP α GPC GPC GPC α GPC GPC Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 30 / 35

Scheduling and Arbitration Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 31 / 35

Mixed Hierarchical Scheduling Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 32 / 35

Complete System Composition Input Stream CPU BUS DSP Concrete Instance RM TDMA Abstract Representation α β CP U β BUS β DSP TDMA GPC GPC GPC α GPC GPC Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 33 / 35

RTC Toolbox (http://www.mpa.ethz.ch/rtctoolbox) Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 34 / 35

Advantages and Disadvantages of RTC and MPA Advantages More powerful abstraction than classical real-time analysis Resources are first-class citizens of the method Allows composition in terms of (a) tasks, (b) streams, (c) resources, (d) sharing strategies. Disadvantages Needs some effort to understand and implement Extension to new arbitration schemes not always simple Not applicable for schedulers that change the scheduling policies dynamically. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 35 / 35