Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G....

36
| | L. Sigrist , G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory, ETH Zurich 15.04.2015 Lukas Sigrist, Computer Engineering Group, ETH Zurich 1 Mixed-Criticality Runtime Mechanisms and Evaluation on Multicores

Transcript of Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G....

Page 1: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele

Computer Engineering and Networks Laboratory, ETH Zurich

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 1

Mixed-Criticality Runtime Mechanisms

and Evaluation on Multicores

Page 2: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Integration of mixed-criticality (MC) applications into a common

platform

Criticality level (CL) expresses required protection against failure

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 2

Mixed-Criticality Systems

© THALES

Page 3: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Challenges

Independence between the different CL

Resource efficiency

More complex runtime mechanisms needed

Monitoring

Mode switching

Global synchronization

Task termination

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 3

Scheduling Mixed-Criticality Tasks

Page 4: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

|| 15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 4

Mixed-Criticality Services

Core 1

Core 2 Core 4

Core 3

BUSdecision

monitoring

defer task deadline

Page 5: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Multicore Mixed-Criticality Scheduling Policies

R.M. Pathan, Schedulability Analysis of Mixed-Criticality Systems on Multiprocessors,

ECRTS 2012.

G. Giannopoulou et al., Scheduling of Mixed-Criticality Applications on Resource-

Sharing Multicore Systems, EMSOFT 2013.

S. Baruah et al., Mixed-criticality scheduling on multiprocessors, RTS 2014.

Mixed-Criticality Scheduling Frameworks

J. Anderson et al., Multicore operating-system support for mixed criticality, WMC 2009.

J. Herman et al., RTOS Support for Multicore Mixed-Criticality Systems, RTAS 2012.

H.-M. Huang et al., Implementation and Evaluation of Mixed-criticality Scheduling

Approaches for Sporadic Tasks, TECS 2014.

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 5

Related Work

Page 6: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

|| 15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 6

Motivation

How can we quantify their runtime overheads

and their impact on schedulability?

How can we implement mixed-criticality

mechanisms efficiently on multicore systems?

Page 7: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Monitored task 𝜏𝑖: 𝐶𝑖 LO , 𝐶𝑖 HI for LO/HI criticality WCET

Overrun at 𝑡, mode switch delayed by detection and termination 𝐶𝐾

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 7

Motivational Example

Page 8: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Monitored task 𝜏𝑖: 𝐶𝑖 LO , 𝐶𝑖 HI for LO/HI criticality WCET

Overrun at 𝑡, mode switch delayed by detection and termination 𝐶𝐾

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 7

Motivational Example

Page 9: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Monitored task 𝜏𝑖: 𝐶𝑖 LO , 𝐶𝑖 HI for LO/HI criticality WCET

Overrun at 𝑡, mode switch delayed by detection and termination 𝐶𝐾

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 7

Motivational Example

Page 10: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Monitored task 𝜏𝑖: 𝐶𝑖 LO , 𝐶𝑖 HI for LO/HI criticality WCET

Overrun at 𝑡, mode switch delayed by detection and termination 𝐶𝐾

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 7

Motivational Example

Page 11: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Monitored task 𝜏𝑖: 𝐶𝑖 LO , 𝐶𝑖 HI for LO/HI criticality WCET

Overrun at 𝑡, mode switch delayed by detection and termination 𝐶𝐾

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 7

Motivational Example

Page 12: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

|| 15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 8

Motivational Example: Monitoring Overhead

Monitoring Period [ms]

Mo

nito

rin

g W

CE

T [m

s]

Termination overhead 𝐶𝐾 = 3 ms

Page 13: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Scheduling Policies

Flexible Time-Triggered and Synchronization-based (FTTS) scheduler

Partitioned EDF with Virtual Deadlines (pEDF-VD)

Mixed-Criticality Runtime Mechanisms

Execution Time Monitoring

Scheduler Mode Switch

Task Termination

Mixed-Criticality Scheduling Framework

Evaluation on Multicore Systems

Estimation of Runtime Overheads

Effect of Overheads on Schedulability

Avionics Case Study

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 9

Outline

Page 14: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Scheduling Policies

Flexible Time-Triggered and Synchronization-based (FTTS) scheduler

Partitioned EDF with Virtual Deadlines (pEDF-VD)

Mixed-Criticality Runtime Mechanisms

Execution Time Monitoring

Scheduler Mode Switch

Task Termination

Mixed-Criticality Scheduling Framework

Evaluation on Multicore Systems

Estimation of Runtime Overheads

Effect of Overheads on Schedulability

Avionics Case Study

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 10

Outline

Page 15: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Periodic task sets 𝜏 = 𝜏1, … , 𝜏𝑛

Task 𝜏𝑖 = 𝑇𝑖 , 𝜒𝑖 , 𝐶𝑖 LO , 𝐶𝑖 HI Period 𝑇𝑖 Criticality level 𝜒𝑖 ∈ LO, HI

Worst case execution time (WCET) at LO criticality 𝐶𝑖 LO

WCET at HI criticality 𝐶𝑖 HI (𝐶𝑖 HI = 0 for 𝜒𝑖 = LO)

Deadline equal to period 𝐷i = 𝑇𝑖

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 11

Task Model

Page 16: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Sub-frames for criticality levels

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 12

Flexible Time-Triggered FTTS Scheduler [1]

[1] G. Giannopoulou, N. Stoimenov, P. Huang, and L. Thiele. Scheduling of Mixed-Criticality Applications

on Resource-Sharing Multicore Systems. 2013.

Page 17: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Sub-frames for criticality levels

Skip LO sub-frame on HI overrun

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 13

Flexible Time-Triggered FTTS Scheduler

Page 18: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Sub-frames for criticality levels

Skip LO sub-frame on HI overrun

Global decision at sub-frame switch

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 14

Flexible Time-Triggered FTTS Scheduler

Page 19: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Based on single core EDF with Virtual Deadlines

Mode switch on LO WCET overrun

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 15

Partitioned EDF with Virtual Deadlines [2]

[2] S. Baruah, B. Chattopadhyay, H. Li, and I. Shin. Mixed-criticality scheduling on multiprocessors. 2014.

Page 20: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Based on single core EDF with Virtual Deadlines

Mode switch on LO WCET overrun

Offline partitioning

First fit bin packing algorithm

Independent execution

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 15

Partitioned EDF with Virtual Deadlines [2]

[2] S. Baruah, B. Chattopadhyay, H. Li, and I. Shin. Mixed-criticality scheduling on multiprocessors. 2014.

Page 21: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Scheduling Policies

FTTS

pEDF-VD

Mixed-Criticality Runtime Mechanisms

Execution Time Monitoring

Scheduler Mode Switch

Task Termination

Mixed-Criticality Scheduling Framework

Evaluation on Multicore Systems

Estimation of Runtime Overheads

Effect of Overheads on Schedulability

Avionics Case Study

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 16

Outline

Page 22: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Heartbeat monitoring

Integration in analysis

Delayed detection

Deadline-based monitoring

Detection at overrun

Reduced checks and context

switches

Hard to integrate in analysis

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 17

Runtime Monitoring

Page 23: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Extreme case of degradation

Immediate Termination

No execution before next arrival

Additional overhead at time

critical mode switch

Deferred Termination

Fast mode switch

Tidy up when CPU idle

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 18

Task Termination

Page 24: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Scheduling Policies

FTTS

pEDF-VD

Mixed-Criticality Runtime Mechanisms

Execution Time Monitoring

Scheduler Mode Switch

Task Termination

Mixed-Criticality Scheduling Framework

Evaluation on Multicore Systems

Estimation of Runtime Overheads

Effect of Overheads on Schedulability

Avionics Case Study

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 19

Outline

Page 25: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Extension of existing SF3P [3]

User space framework

Portable

Easily extensible

Rapid prototyping and testing

Features

Mixed-criticality mechanisms

Multicore support

Execution time tracing

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 20

Framework Implementation

[3] A. Gomez, L. Schor, P. Kumar and L. Thiele. SF3P: A Framework to Explore and Prototype

Hierarchical Compositions of Real-Time Schedulers. 2014.

Page 26: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Scheduling

Priority based kernel scheduler

Communication

Shared memory (mutexes, semaphores)

Synchronization

POSIX barrier (futex based user-space mechanism)

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 21

Framework Implementation

Page 27: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Scheduling Policies

FTTS

pEDF-VD

Mixed-Criticality Runtime Mechanisms

Execution Time Monitoring

Scheduler Mode Switch

Task Termination

Mixed-Criticality Scheduling Framework

Evaluation on Multicore Systems

Estimation of Runtime Overheads

Effect of Overheads on Schedulability

Avionics Case Study

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 22

Outline

Page 28: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Simulation

100 task sets per utilization

4-32 cores

System utilization from 0.2 to 32.0

40% of tasks with HI criticality level

Execution for 10 seconds

COTS platforms

Intel Xeon Phi Coprocessor 5110P (60 cores)

Linux 2.6.38.8, GNU libc v2.14

Intel Core i5-4670 (4 cores)

Linux 3.13.0, GNU libc v2.19

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 23

Experiments for Overhead Evaluation

Page 29: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Configuration

Utilization 0.8-6.4

Overrun probability 30%

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 24

Overhead Scaling with Number of Cores (FTTS)

Global overheads dominate

Average overhead across cores

Page 30: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Configuration

Utilization 0.2-12.0

Overrun probability 50%

Cores after partitioning

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 25

Overhead Scaling with Number of Cores (pEDF-VD)

Deferred termination results

in fast mode switch

Distributed monitoring

keeps overhead low

Average overhead across cores

Page 31: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Negligible impact for pEDF-VD

Low overhead, no inter-core communication

Conservative schedulability condition for partitioning

No deadline overruns observed

Theoretical schedulable executed

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 26

Impact on pEDF-VD Schedulability

Page 32: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Theoretical schedulability incl. barrier overheads

Average overhead

Worst case overhead

Compare to empirical schedulability

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 27

Impact on FTTS Schedulability

Cores Average [ms] Maximum [ms]

4 1.7 45

8 2.5 126

16 3.2 143

32 5 160

Synchronization and sub-frame overhead

Page 33: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

|| 15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 28

Impact on FTTS Schedulability (8 Cores)

-50%

Page 34: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Flight Management System

11 periodic tasks (200 ms, 1 s, 5 s periods)

FTTS optimization for 4 cores

Extra memory allocation for HI tasks in 50% of executions

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 29

Industrial Avionics Example

0

1

2

3

4

5

Scheduler Overhead [%] System Overhead [%] Total Overhead [%]

Xeon Phi

Core i5

0.360.03 1.74⋅10-4

4.90

0.36

4.93

Page 35: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

|| 15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 29

Industrial Avionics Example

Rapid prototyping and fast comparison of policies

and available platforms

0

1

2

3

4

5

Scheduler Overhead [%] System Overhead [%] Total Overhead [%]

Xeon Phi

Core i5

0.360.03 1.74⋅10-4

4.90

0.36

4.93

Page 36: Mixed-Criticality Runtime Mechanisms and Evaluation on … · 2018. 5. 4. · L. Sigrist, G. Giannopoulou, P. Huang, A. Gomez, L. Thiele Computer Engineering and Networks Laboratory,

||

Implementation alternatives for MC mechanisms

User-space framework

Rapid prototyping and comparison of policies and implementations

Fast platform evaluation

Consider runtime overheads at design time

Affect the schedulability

Efficient, timing-predictable mechanisms needed

Operating system

Platform

15.04.2015Lukas Sigrist, Computer Engineering Group, ETH Zurich 30

Conclusion