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

Similar documents
Embedded Systems 23 BF - ES

Real-Time Calculus. LS 12, TU Dortmund

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

Shedding the Shackles of Time-Division Multiplexing

CS 700: Quantitative Methods & Experimental Design in Computer Science

CEC 450 Real-Time Systems

How to deal with uncertainties and dynamicity?

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

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

CSE 380 Computer Operating Systems

Schedulability Analysis for the Abort-and-Restart Model

Component-based Analysis of Worst-case Temperatures

Embedded systems engineering Distributed real-time systems

Cache-Aware Compositional Analysis of Real- Time Multicore Virtualization Platforms

Caches in WCET Analysis

The Concurrent Consideration of Uncertainty in WCETs and Processor Speeds in Mixed Criticality Systems

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

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

Clock-driven scheduling

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

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

CPU SCHEDULING RONG ZHENG

Embedded Systems Development

Temperature-Aware Analysis and Scheduling

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

Real-Time Scheduling and Resource Management

Design and Analysis of Time-Critical Systems Response-time Analysis with a Focus on Shared Resources

Timing analysis and timing predictability

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

Online Scheduling Switch for Maintaining Data Freshness in Flexible Real-Time Systems

Module 5: CPU Scheduling

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

Chapter 6: CPU Scheduling

Fast and Accurate Transaction-Level Model of a Wormhole Network-on-Chip with Priority Preemptive Virtual Channel Arbitration

FACTORS AFFECTING CONCURRENT TRUNCATE

The preemptive uniprocessor scheduling of mixed-criticality implicit-deadline sporadic task systems

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

Timing analysis and predictability of architectures

Time and Schedulability Analysis of Stateflow Models

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

Robust Programs with Filtered Iterators

A Proposed Driver Assistance System in Adverse Weather Conditions

Distributed Systems Part II Solution to Exercise Sheet 10

CHAPTER 3. CAPACITY OF SIGNALIZED INTERSECTIONS

Snow Removal Equipment Visibility

CPU Scheduling. CPU Scheduler

arxiv: v1 [cs.dc] 9 Feb 2015

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

Energy-Efficient Real-Time Task Scheduling in Multiprocessor DVS Systems

Toward Precise PLRU Cache Analysis

Design Priciples of Traffic Signal

An Optimal k-exclusion Real-Time Locking Protocol Motivated by Multi-GPU Systems

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

Uniprocessor Mixed-Criticality Scheduling with Graceful Degradation by Completion Rate

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

Coscheduling of Real-Time Tasks and PCI Bus Transactions

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

Fine Grain Quality Management

Real Time Operating Systems

A Probabilistic Relational Model for Characterizing Situations in Dynamic Multi-Agent Systems

Buffer Capacity Computation for Throughput Constrained Streaming Applications with Data-Dependent Inter-Task Communication

Networked Embedded Systems WS 2016/17

Probabilistic Deadline Miss Analysis of Real-Time Systems Using Regenerative Transient Analysis

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

EDF Feasibility and Hardware Accelerators

On the Soft Real-Time Optimality of Global EDF on Multiprocessors: From Identical to Uniform Heterogeneous

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

ww.padasalai.net

LSN 15 Processor Scheduling

Scheduling Slack Time in Fixed Priority Pre-emptive Systems

A 2-Approximation Algorithm for Scheduling Parallel and Time-Sensitive Applications to Maximize Total Accrued Utility Value

1 st Semester 2007/2008

Lane Marker Parameters for Vehicle s Steering Signal Prediction

Section 6 Fault-Tolerant Consensus

IEEE TRANSACTIONS ON COMPUTER-AIDED DESIGN OF INTEGRATED CIRCUITS AND SYSTEMS 1

CMP N 301 Computer Architecture. Appendix C

A compositional approach to embedded system performance analysis

HELLA AGLAIA MOBILE VISION GMBH

Latches. October 13, 2003 Latches 1

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

Design of Real-Time Software

Computation Offloading Strategy Optimization with Multiple Heterogeneous Servers in Mobile Edge Computing

A Starvation-free Algorithm For Achieving 100% Throughput in an Input- Queued Switch

Bounding the End-to-End Response Times of Tasks in a Distributed. Real-Time System Using the Direct Synchronization Protocol.

Leveraging Task-Parallelism in Energy-Efficient ILU Preconditioners

Efficient Power Management Schemes for Dual-Processor Fault-Tolerant Systems

Simulation of Process Scheduling Algorithms

MAT SYS 5120 (Winter 2012) Assignment 5 (not to be submitted) There are 4 questions.

Mapping to Parallel Hardware

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

CS 347 Parallel and Distributed Data Processing

Schedulability Analysis for the Abort-and-Restart (AR) Model

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

Effective Bandwidth for Traffic Engineering

Mejbah Alam. Justin Gottschlich. Tae Jun Lee. Stan Zdonik. Nesime Tatbul

Timing-aware FPGA Partitioning for Real-Time Applications Under Dynamic Partial Reconfiguration

Approximate Queueing Model for Multi-rate Multi-user MIMO systems.

Analysis of real-time system conflict based on fuzzy time Petri nets

Optimizing Loop Operation and Dataflow in FPGA Acceleration of Deep Convolutional Neural Networks

One Optimized I/O Configuration per HPC Application

Transcription:

Leveraging Transactional Memory for a Predictable Execution of Applications Composed of Hard Real-Time and Best-Effort Tasks Stefan Metzlaff, Sebastian Weis, and Theo Ungerer Department of Computer Science, University of Augsburg, Germany International Conference on Real-Time Networks and Systems October 16, 2013 RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 1

Motivation Real-Time and Multi-Cores I Safety-critical embedded systems I Increasing parallelism I Interferences at shared resources I I I Access on shared data structures Real-time capable concurrency, Predictable execution in multi-cores RTNS 2013 A380, [1] Interferences in parallel applications I I Access to bus, memory, and I/O Predictable arbitration with bandwidth guarantees (e.g. TDMA) Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks Google Driverless Car, [2] 2

Outline Transactional Memory for HRT systems HRT-TM - Enhancement for Non Real-Time Evaluation and Conclusion RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 3

Transactional Memory for HRT systems Derived from database transactions Optimistic concurrency control Simplifies parallel programming Requirements for hard real-time (HRT) TM Predictable worst-case behaviour of TM primitives Commit guarantee for each transaction Calculable number of transaction aborts RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 4

HRT-TM Design Overview (1) Predictable worst-case behaviour of TM primitives TM-Begin, TM-End, TM-Abort, (Rollback+Retry) Implemented in predictable hardware (TDMA bus/no cache) Read set/write set accesses upper-bounded Commit guarantee for each transaction FIFO transaction commit queue Registering transactions on transaction begin Core 1 Core 2 HTM Ext. Working Set Buffer Memory Bus HTM Ext. Working Set Buffer I/O Device HTM Mgmt. TX Status Info. HRT FIFO Queue RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 5

HRT-TM Design Overview (2) Calculable number of transaction aborts HRT contention manager (commit serialisation) Lazy versioning HRT manager supports lazy/eager conflict detection Core 1 Core 2 HTM Ext. Working Set Buffer Memory Bounded maximum transaction delay Conclusion Allows calculation of WCET bounds (the set of concurrent transactions must be known) Bus HTM Ext. Working Set Buffer I/O Device HTM Mgmt. TX Status Info. HRT FIFO Queue RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 6

Lazy Conflict Detection WCET Estimation Worst-case scenario for a transaction 1. Worst-Case Conflicts All concurrently executed transactions have conflicting working sets 2. Worst-Case Commit Delay The transaction has to be at the back position of the commit queue 3. Worst-Case Release Time All transactions are released at the same time 4. Worst-Case Transaction Order The shortest transaction is in the front position, followed by the longest RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 7

Lazy Conflict Detection RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 8

Lazy Conflict Detection RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 8

Lazy Conflict Detection RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 8

Lazy Conflict Detection RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 8

Lazy Conflict Detection 1 2 3 4 Commit Queue 1 2 3 4 2 3 4 3 4 4 t Execute Corrupted Wait Commit Abort RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 8

Eager Conflict Detection WCET Estimation Worst-case scenario for a transaction 1. Worst-Case Conflicts All concurrently executed transactions have conflicting working sets 2. Worst-Case Commit Delay The transaction has to be at the back position of the commit queue 3. Worst-Case Release Time All transactions are released at the same time No Worst-Case Transaction Order WCET is independent from the transaction ordering RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 9

Eager Conflict Detection RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 10

Eager Conflict Detection RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 10

Eager Conflict Detection RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 10

Eager Conflict Detection RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 10

Eager Conflict Detection 1 2 3 4 Commit Queue 1 2 3 4 2 3 4 3 4 4 t Execute Wait Commit Abort RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 10

Lazy vs. Eager CD Lazy Fewer rollback in case of conflicts Global progress stall depends on ratio of the largest and smallest transaction Eager No global progress stall Transaction Order is irrelevant RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 11

Lazy vs. Eager CD Lazy Fewer rollback in case of conflicts Global progress stall depends on ratio of the largest and smallest transaction Eager No global progress stall Transaction Order is irrelevant Conclusion With increasing heterogeneity of the transactions the choice of the conflict detection becomes more important RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 11

HRT-TM Enhancement for Non Real-Time Applications with tasks of different RT requirements e.g.: Advanced Driver Assistance System Hard real-time (HRT): collision avoidance Soft real-time (SRT): night vision Best-effort (BE): traffic sign recognition Data sharing among applications Limiting interference of non-hrt tasks Collision Avoidance, HRT, [3] Night Vision, SRT, [4] Traffic Sign Recognition, BE, [5] RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 12

Extension to Parallel HRT/BE Applications TM manager with second queue for BE tasks BE tasks commit only when no HRT task is running Core 1 Core 2 HTM Ext. Working Set Buffer Memory Bus HTM Ext. Working Set Buffer I/O Device HTM Mgmt. TX Status Info. HRT FIFO Queue BE FIFO Queue Bounding possible interferences of BE transactions RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 13

Possible Overlaps of HRT and BE Transactions HRT starts while BE commits BE HRT HRT BE Wait Commit Abort t RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 14

Possible Overlaps of HRT and BE Transactions HRT starts while BE commits BE HRT HRT BE Wait Commit Abort Interference (but bounded by t e + t a of HRT) t RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 14

Possible Overlaps of HRT and BE Transactions HRT starts while BE commits BE HRT HRT BE Wait Commit Abort Interference (but bounded by t e + t a of HRT) HRT waits until BE commits BE HRT HRT BE Wait Commit Abort t t RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 14

Possible Overlaps of HRT and BE Transactions HRT starts while BE commits BE HRT HRT BE Wait Commit Abort Interference (but bounded by t e + t a of HRT) HRT waits until BE commits BE HRT HRT BE Wait Commit Abort Interference (but bounded by t c of BE) t t RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 14

Conclusion on Prioritised TM Contention Manager BE tasks interfere with HRT tasks on TM commit Commit duration depends on the transaction write set Analysis requires profiling of BE write sets only Worst-Case Interference with HRT task: Bounded by max i TXBE (t ci ) RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 15

Evaluation Methodology System Model MERASA quad-core with TDMA bus Benchmark Synchrobench Linked List with 50 entries Table: Characteristics of the Linked List Operation Tasks Task Max. Max. WCET Bound RS-Size WS-Size in Isolation add (a) 400 bytes 12 bytes 1977 cycles remove (r) 400 bytes 4 bytes 1806 cycles normalise (n) 400 bytes 200 bytes 2755 cycles RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 16

Evaluation Results Case study: static WCET analysis of linked list operations Lazy conflict detection WCET estimate of HRT remove (r) executed in parallel with HRT add (a) and HRT/BE normalise (n) 5 Normalised WCET Estimate 4 3 2 1 0 r r+a r+a+n HRT r+a+n BE Executed Workload Minimal impact of BE task on WCET bounds of HRT tasks RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 17

Conclusions An analysable TM system for HRT tasks Commit guarantee for each transaction Calculable number of transaction aborts Supports eager and lazy conflict detection RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 18

Conclusions An analysable TM system for HRT tasks Commit guarantee for each transaction Calculable number of transaction aborts Supports eager and lazy conflict detection Enhancement for non real-time HRT contention manager with a two-level commit scheduling Interferences depend on commit time of BE tasks Low impact of BE tasks on WCET of HRT tasks RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 18

Conclusions An analysable TM system for HRT tasks Commit guarantee for each transaction Calculable number of transaction aborts Supports eager and lazy conflict detection Enhancement for non real-time HRT contention manager with a two-level commit scheduling Interferences depend on commit time of BE tasks Low impact of BE tasks on WCET of HRT tasks Our approach allows the independent development of BE tasks with limited interferences on the HRT tasks RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 18

Conclusions An analysable TM system for HRT tasks Commit guarantee for each transaction Calculable number of transaction aborts Supports eager and lazy conflict detection Enhancement for non real-time HRT contention manager with a two-level commit scheduling Interferences depend on commit time of BE tasks Low impact of BE tasks on WCET of HRT tasks Our approach allows the independent development of BE tasks with limited interferences on the HRT tasks Future work: Extend the approach to soft real-time tasks RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 18

Questions? RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 19

Backup Slides RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 20

Parallel HRT/BE Applications and Optimistic Concurrency Control worker task 0 worker task 1 shared data system monitor task worker task 2 Conventional HRT system Worker and Monitoring tasks are HRT tasks All tasks must be analysable HRT/BE TM system Worker tasks are HRT tasks and must be analysable Only working set of BE Monitoring task must be known RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 21

Possible Overlaps of HRT and BE Transactions HRT starts before BE BE HRT t HRT BE Wait Commit Abort HRT starts while BE running No interference BE HRT HRT BE Wait Commit Abort t No interference RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 22

Evaluation of NRT & HRT Tasks No. of Iterations No. of Iterations Core Type w. Delay of Type w. Delay of 0 600 1,800 0 600 1,800 1 HRT 50 50 50 HRT 50 50 50 2 HRT 45 46 48 BE 14 23 40 3 HRT 44 45 48 BE 13 23 39 4 HRT 44 44 48 BE 13 22 38 Table: Number of Iterations for the add Operation on a Shared Linked List in System with HRT and BE Tasks RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 23

HRT-TM Proposal WCET Estimation Method Transaction 1. Program analysis per task 2. TX extraction & characterisation 3. Exchange of TX characteristics among all tasks 4. WCET estimation of each TX including interferences of any concurrent TX 5. TX reduction per task 6. WCET calculation per task Transaction Predictable concurrency control in shared memory systems RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 24

Images [1] http://www.flickr.com/photos/8313254@n08/496320750/ [2] http://www.flickr.com/photos/jurvetson/5499949739/ [3] http://www.flickr.com/photos/13524418@n07/2921138655/ [4] http://www.flickr.com/photos/jurvetson/22226826/ [5] Eichner, M.L.; Breckon, T.P., Integrated speed limit detection and recognition from real-time video, Intelligent Vehicles Symposium, pp.626-631, 2008, IEEE RTNS 2013 Metzlaff, Weis, and Ungerer / TM for Applications Composed of HRT & BE Tasks 25