Worst-Case Scheduling of Software Tasks

22
CP 2014 Lyon, 10/09/1914 Worst-case Scheduling of Software Tasks A Constraint Optimization Model to Support Performance Testing Stefano Di Alesio 1,2 Shiva Nejati 2 Lionel Briand 2 Arnaud Gotlieb 1 1 Certus Centre for Software V&V Simula Research Laboratory Norway 2 Interdisciplinary Centre for Reliability, Security and Trust (SnT) University of Luxembourg Luxembourg

description

Β 

Transcript of Worst-Case Scheduling of Software Tasks

Page 1: Worst-Case Scheduling of Software Tasks

CP 2014 Lyon, 10/09/1914

Worst-case Scheduling of Software Tasks A Constraint Optimization Model to Support Performance Testing

Stefano Di Alesio 1,2

Shiva Nejati 2

Lionel Briand 2

Arnaud Gotlieb 1

1 Certus Centre for Software V&V Simula Research Laboratory Norway

2 Interdisciplinary Centre for Reliability, Security and Trust (SnT) University of Luxembourg Luxembourg

Page 2: Worst-Case Scheduling of Software Tasks

We present a Constrained Optimization Model to support Performance Testing in RTES

Industrial Experience: Context, Process and Results

Stefano Di Alesio - 2/19

Performance Requirements vs. Real Time Embedded Systems (RTES)

Supporting Performance Testing: A novel application for COPs

Page 3: Worst-Case Scheduling of Software Tasks

RTES are typically safety-critical, and thus bound to meet strict Performance Requirements

Stefano Di Alesio - 3/19

Page 4: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 4/19

Our case study is a monitoring application for fire/gas leaks detection in offshore platforms

Computing Hardware (Tri-core Processor)

Real Time Operating System (VxWorks)

Drivers (SW-HW Interface)

~100 Drivers * ~5 kLoC

Control Modules (Application Logic)

~5000 Modules * ~1 kLoC

Human Operators (Engineers)

External Hardware (Sensors + Actuators)

~500 devices

KM: Kongsberg Maritime FMS: Fire and gas Monitoring System

Page 5: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 5/19

Drivers transfer data between external hardware (sensors and actuators) and control modules

PullData! Queue!IOBR!BoxIn! IOQW! IOQR! IOBW! BoxOut! PushData!

2.write! 3.check!

4.read!

5.trigger!

6.write! 7.check!

8.read!9.trigger!

10.write! 11.scan!

12.read!

External Hardware (Sensors + Actuators)

~500 devices

Control Modules (Application Logic)

~5000 Modules * ~1 kLoC

1.scan!

13.send!

Page 6: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 6/19

PullData!

1.scan!

Queue!IOBR!BoxIn! IOQW! IOQR! IOBW! BoxOut! PushData!

2.write! 3.check!

4.read!

5.trigger!

6.write! 7.check!

8.read!9.trigger!

10.write! 11.scan!

12.read!13.send!

The FMS drivers have performance requirements on task deadlines, response time, and CPU usage

1) No task should miss its deadline

2) Response Time < 1 sec

3) CPU Usage < 20%

Page 7: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 7/19

PullData!

1.scan!

Queue!IOBR!BoxIn! IOQW! IOQR! IOBW! BoxOut! PushData!

2.write! 3.check!

4.read!

5.trigger!

6.write! 7.check!

8.read!9.trigger!

10.write! 11.scan!

12.read!13.send!

Our goal is to identify worst-case scenarios w.r.t. deadline misses, response time, and CPU usage

The arrival times of check depend on the buffers status, which in turn depends on the environment

The main variable impacting deadline misses, response time, and CPU usage, are the arrival times of check

Page 8: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 8/19

PullData!

1.scan!

Queue!IOBR!BoxIn! IOQW! IOQR! IOBW! BoxOut! PushData!

2.write! 3.check!

4.read!

5.trigger!

6.write! 7.check!

8.read!9.trigger!

10.write! 11.scan!

12.read!13.send!

Each worst-case scenario can characterize a test case in terms of the arrival times of check

Therefore, we need a strategy to search for the arrival times of check

The check signal can be manipulated during testing (e.g. simulating the environment)

π’„π’‰π’†π’„π’Œβ†“πŸβŸ=𝟐𝟎  π’Žπ’”!!π’„π’‰π’†π’„π’Œβ†“πŸβŸ=πŸ’πŸ–  π’Žπ’”!!π’„π’‰π’†π’„π’Œβ†“πŸ‘βŸ=πŸ“πŸŽ  π’Žπ’”!!

π’…π’†π’‚π’…π’π’Šπ’π’†_π’Žπ’Šπ’”π’”π’†π’”=𝑡/𝑨!!𝒓𝒆𝒔𝒑𝒐𝒏𝒔𝒆_π’•π’Šπ’Žπ’†=πŸ—πŸŽπŸŽ  π’Žπ’”!!𝒄𝒑𝒖_π’–π’”π’‚π’ˆπ’†=πŸπŸ“%  !

Page 9: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 9/19

Several techniques have been used for solving similar problems, but each has its own weaknesses

Verification Testing!Schedulability

Theory!Model

Checking!Performance Engineering!

Genetic Algorithms!

Basis Mathematical Theory

System Modeling

Practice and Tools!

System Modeling

Background Queuing Theory Fixed-point Computation

Profiling, Benchmarking!

Meta-Heuristic Search

Key Features Theorems Graph-based, Symbolic

Dynamic Analysis!

Non-Complete Search

Weaknesses Assumptions,!Multi-Core

Complex Modeling

Non Systematic!

Low Effectiveness

SE!

CP!

Multi-core Priority Preemption Dependency Triggering

Job-shop schedulability analysis

Page 10: Worst-Case Scheduling of Software Tasks

Constrained Optimization Problem (COP)

Static Properties of Tasks (Constants)

Dynamic Properties of Tasks (Variables)

Performance Requirement (Objective Function)

OS Scheduler Behaviour (Constraints)

Search Heuristics

OS Scheduler Behaviour (Labeling Strategy)

Stefano Di Alesio - 10/19

We cast the search for the arrival times of the check signal leading to worst-case scenarios as a COP

The COP models a multi-core priority-driven preemptive scheduler with task triggering and dependencies

Page 11: Worst-Case Scheduling of Software Tasks

β€’β€―Observation Interval: 𝑻=[𝟎,  πŸ—]!β€’β€―Number of cores: 𝒄=𝟐 β€’β€―Set of Tasks: 𝑱={ π’‹β†“πŸŽβŸ, π’‹β†“πŸβŸ,   π’‹β†“πŸβŸ,   π’‹β†“πŸ‘βŸ}

β€’β€―Priority of Tasks: 𝒑𝒓(π’‹β†“π’ŠβŸ)=π’Š β€’β€―Period of Tasks: 𝒑𝒆(π’‹β†“πŸβŸ)=πŸ“ β€’β€―Min/Max Inter-arrival time of Tasks: π’Žπ’(π’‹β†“πŸŽβŸ)=πŸ“,π’Žπ’™(π’‹β†“πŸŽβŸ)=𝟏𝟎

β€’β€―Duration of Tasks: 𝒅𝒓(π’‹β†“πŸŽβŸ)=πŸ‘ β€’β€―Deadline of Tasks: 𝒅𝒍(π’‹β†“πŸŽβŸ)=πŸ• β€’β€―Triggering Relation: π’•π’ˆ(π’‹β†“πŸŽβŸ, π’‹β†“πŸβŸ) β€’β€―Dependency Relation: 𝒅𝒆( π’‹β†“πŸβŸ, π’‹β†“πŸβŸ) β€’β€―Number of Periodic Task Executions: 𝒕𝒆(𝒋)=βŒŠπ’•π’’/𝒑𝒆(𝒋)βŸβŒ‹,    π’•π’†(π’‹β†“πŸβŸ)=⌊𝟏𝟎/πŸ“βŸβŒ‹=𝟐!!

0123456789

π’•π’“π’Šπ’ˆπ’ˆπ’†π’“!

   π’‹πŸŽ!!    π’‹πŸ!!     π’‹β†“πŸ‘βŸ!    π’“πŸπŸ!!     π’‹β†“πŸβŸ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

Static Properties depend on the FMS design, and are modeled as Constants

Constants

Stefano Di Alesio - 11/19

Time is discretized in our analysis: we solve an IP over finite domains

Page 12: Worst-Case Scheduling of Software Tasks

Independent β€’β€―Number of Aperiodic Task Exec.: 𝒕𝒆(𝒋)  π  [𝒕𝒒/π’Žπ’™(𝒋) , 𝒕𝒒/π’Žπ’(𝒋) ],    π’•π’†(π’‹β†“πŸŽβŸ)  π  [𝟏,𝟐],  π’•π’†(π’‹β†“πŸŽβŸ)=𝟏

β€’β€―Arrival time of Aperiodic Task Exec.: 𝒂𝒕(𝒋,  π’Œ)  π  π‘»,    π’‚𝒕(π’‹β†“πŸŽβŸ,  πŸŽ)=𝟎,    π’‚𝒄(π’‹β†“πŸ‘βŸ,𝟏)=πŸ•

β€’β€―Active time of Task Executions: 𝒂𝒄(𝒋,  π’Œ,𝒑)  π  π‘»,    π’‘  π  [𝟎,𝒅𝒓(𝒋)βˆ’πŸ],    π’‚𝒄(π’‹β†“πŸŽβŸ,  πŸŽ,𝟎)=𝟎,    π’‚𝒄(π’‹β†“πŸŽβŸ,𝟎,𝟏)=𝟐

Dynamic Properties depend on the FMS runtime behavior, and are modeled as Variables (1/2)

Variables

𝒕𝒆 and 𝒂𝒕 of Periodic Tasks Executions are constants: and 𝒂𝒕 of Periodic Tasks Executions are constants: of Periodic Tasks Executions are constants: 𝒕𝒆(𝒋)=βŒŠπ’•π’’/𝒑𝒆(𝒋)βŸβŒ‹,    π’•π’†(π’‹β†“πŸβŸ)=  βŒŠπŸπŸŽ/πŸ“βŸβŒ‹=𝟐 𝒂𝒕(𝒋,  π’Œ)=π’Œβˆ—π’‘π’†(𝒋),    π’‚𝒕(π’‹β†“πŸβŸ,  πŸ)=πŸβˆ—πŸ“=πŸ“  

Stefano Di Alesio - 12/19

0123456789

π’•π’“π’Šπ’ˆπ’ˆπ’†π’“!

   π’‹πŸŽ!!    π’‹πŸ!!     π’‹β†“πŸ‘βŸ!    π’“πŸπŸ!!     π’‹β†“πŸβŸ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

Quantification over non-ground sets: 𝑲=[𝟎, π’Žπ’‚π’™β”¬π’‹βŸ (𝒕𝒒/π’Žπ’(𝒋) ) ] βˆ€π’Œβˆˆ π‘²β†“π’‹βŸβ‹…  π‘ͺ(π’Œ)β†”βˆ€π’Œβˆˆπ‘²β‹…(π’Œ<𝒕𝒆(𝒋))β†’π‘ͺ(π’Œ) βˆ‘π’Œβˆˆ π‘²β†“π’‹βŸβ†‘β–’π‘¬(𝒙) =βˆ‘π’Œβˆˆπ‘²β†‘β–’(π’Œ<𝒕𝒆(𝒋))⋅𝑬(π’™βŸ)

Dependent (1/2) β€’β€―Set of Aperiodic Task Executions: π‘²β†“π’‹βŸ=[𝟎,    π’•π’†(𝒋)βˆ’πŸ],   π‘²β†“π’‹β†“πŸŽβŸβŸ=[𝟎]

Page 13: Worst-Case Scheduling of Software Tasks

Dependent (2/2) β€’β€―Start/End time of Task Executions: 𝒔𝒕(𝒋,π’Œ)=𝒂𝒄(𝒋,π’Œ,𝟎),    π’”𝒕(π’‹β†“πŸŽβŸ,𝟎)=𝟎,    π’†π’(𝒋,π’Œ)=𝒂𝒄(𝒋,π’Œ,𝒅𝒓(𝒋)βˆ’πŸ),    π’†π’(π’‹β†“πŸŽβŸ,𝟎)=πŸ‘

β€’β€―Preempted time of Task Executions: π’‘π’Ž(𝒋,  π’Œ,𝒑)=𝒂𝒄(𝒋,π’Œ,𝒑)βˆ’π’‚π’„(𝒋,π’Œ,π’‘βˆ’πŸ),    π’‘π’Ž(π’‹β†“πŸŽβŸ,  πŸŽ,𝟏)=𝟏,    π’‘π’Ž(π’‹β†“πŸŽβŸ,𝟎,𝟐)=𝟎

β€’β€―Waiting time of Task Executions: π’˜π’•(𝒋,  π’Œ)=𝒔𝒕(𝒋,π’Œ)βˆ’π’‚π’•(𝒋,π’Œ),      π’˜π’•(π’‹β†“πŸβŸ,𝟎)=𝟎,    π’˜π’•(π’‹β†“πŸβŸ,  πŸ)=𝟏

β€’β€―Deadline of Task Executions: 𝒆𝒅(𝒋,π’Œ)=𝒂𝒕(𝒋,π’Œ)+𝒅𝒍(𝒋),    π’†π’…(π’‹β†“πŸŽβŸ,𝟎)=𝟎+πŸ”=πŸ”

β€’β€―Deadline Miss of Task Executions: π’…π’Ž(𝒋,π’Œ)=𝒆𝒏(𝒋,π’Œ)βˆ’π’†π’…(𝒋,π’Œ),    π’…π’Ž(π’‹β†“πŸŽβŸ,𝟎)=πŸ‘βˆ’πŸ”=βˆ’πŸ‘

β€’β€―System Load: 𝒍𝒅(𝒕)=  βˆ‘𝒋,π’Œ,𝒑↑▒(𝒂𝒄(𝒋,π’Œ,𝒑)=𝒕) ,    π’π’…(𝟎)=𝟐,    π’π’…(πŸ‘)=𝟏

Dynamic Properties depend on the FMS runtime behavior, and are modeled as Variables (2/2)

Variables

Stefano Di Alesio - 13/19

0123456789

π’•π’“π’Šπ’ˆπ’ˆπ’†π’“!

   π’‹πŸŽ!!    π’‹πŸ!!     π’‹β†“πŸ‘βŸ!    π’“πŸπŸ!!     π’‹β†“πŸβŸ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

Page 14: Worst-Case Scheduling of Software Tasks

β€’β€―Deadline Misses: π‘­β†“π‘«π‘΄βŸ=βˆ‘π’‹,π’Œβ†‘β–’πŸβ†‘π’…π’Ž(𝒋,π’Œ)  ,   π‘­β†“π‘«π‘΄βŸ= πŸβ†‘βˆ’πŸ‘βŸ+ πŸβ†‘βˆ’πŸ‘βŸ+ πŸβ†‘βˆ’πŸβŸ+πŸβ†‘βˆ’πŸβŸ+ πŸβ†‘βˆ’πŸβŸ+ πŸβ†‘βˆ’πŸβŸ β€’β€―Response Time: π‘­β†“π‘Ήπ‘»βŸ= π’Žπ’‚π’™β”¬π’‹,π’ŒβŸ (𝒆𝒏(𝒋,π’Œ))βŸβˆ’ π’Žπ’Šπ’β”¬π’‹,π’ŒβŸ(𝒂𝒕(𝒋,π’Œ)),   π‘­β†“π‘Ήπ‘»βŸ=πŸ–βˆ’πŸŽ=πŸ–   β€’β€―CPU Usage: 𝑭↓π‘ͺπ‘ΌβŸ=   βˆ‘π’•β†‘β–’(𝒍𝒅(𝒕)>𝟎) /π’•π’’βŸ,   𝑭↓π‘ͺπ‘ΌβŸ=𝟎.πŸ—

The Performance Requirements of the FMS are modeled as objective functions to maximize

Objective Function

Stefano Di Alesio - 14/19

π‘­β†“π‘«π‘΄βŸ should properly reward scenarios with deadline misses [1] [1] L. Briand, Y. Labiche, and M. Shousha, β€œUsing genetic algorithms for early schedulability analysis and stress testing in real-time systems”, Genetic Programming and Evolvable Machines, vol. 7 no. 2, pp. 145-170, 2006

0123456789

π’•π’“π’Šπ’ˆπ’ˆπ’†π’“!

   π’‹πŸŽ!!    π’‹πŸ!!     π’‹β†“πŸ‘βŸ!    π’“πŸπŸ!!     π’‹β†“πŸβŸ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

Page 15: Worst-Case Scheduling of Software Tasks

Temporal Ordering β€’β€―Triggered tasks arrive when their triggering task ends: π’•π’ˆ(π’‹β†“πŸβŸ, π’‹β†“πŸβŸ)→𝒆𝒏(π’‹β†“πŸβŸ,π’Œ)=𝒂𝒕(π’‹β†“πŸβŸ,π’Œ) β€’β€―Dependent tasks cannot overlap: 𝒅𝒆(π’‹β†“πŸβŸ, π’‹β†“πŸβŸ)→𝒆𝒏(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ)<𝒔𝒕(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ) βˆ¨π’†π’(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ)<𝒔𝒕(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ)

Well-formedness β€’β€―A task cannot start before it has arrived: 𝒂𝒕(𝒋,π’Œ)≀𝒔𝒕(𝒋,π’Œ)

β€’β€―A task cannot finish before it has completed: 𝒔𝒕(𝒋,π’Œ)+𝒅𝒓(𝒋)≀𝒆𝒏(𝒋,π’Œ)

β€’β€―Arrival times of aperiodic tasks are separated by min/max interarr. times: 𝒂𝒕(𝒋,π’Œβˆ’πŸ)+π’Žπ’(𝒋)≀𝒂𝒕(𝒋,π’Œ)≀𝒂𝒕(𝒋,π’Œβˆ’πŸ)+π’Žπ’™(𝒋)

The FMS scheduler is modeled through constraints among Static and Dynamic properties (1/2)

Constraints

Stefano Di Alesio - 15/19

Multicore β€’β€―The system load is always less than or equal to the number of cores: 𝒍𝒅(𝒕)≀𝒄

0123456789

π’•π’“π’Šπ’ˆπ’ˆπ’†π’“!

   π’‹πŸŽ!!    π’‹πŸ!!     π’‹β†“πŸ‘βŸ!    π’“πŸπŸ!!     π’‹β†“πŸβŸ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

Page 16: Worst-Case Scheduling of Software Tasks

Scheduling Efficiency β€’β€―If a task is waiting, then either

β€’β€―There are no free cores, or β€’β€―A dependent task is active, or β€’β€―A dependent task is preempted

Priority-Driven Preemption β€’β€―If a task is preempted, then there are 𝒄 higher priority tasks running higher priority tasks running

The FMS scheduler is modeled through constraints among Static and Dynamic properties (2/2)

Constraints

Stefano Di Alesio - 16/19

π’‘π’Ž(𝒋,π’Œ,𝒑)⋅𝒄=βˆ‘π’‹β†“πŸβŸ:  π’‘𝒓(π’‹β†“πŸβŸ)>𝒑𝒓(𝒋),  π’Œβ†“πŸβŸ,       π’‘β†“πŸβŸ  β†‘▒𝒂𝒄(𝒋,π’Œ,π’‘βˆ’πŸ)<𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)<𝒂𝒄(𝒋,π’Œ,𝒑) !π’˜π’•(𝒋,π’Œ)=𝒉𝒂(𝒋,π’Œ)+𝒅𝒂(𝒋,π’Œ)+𝒅𝒑(𝒋,π’Œ){β–ˆβ– π’‰π’‚(𝒋,π’Œ)= 𝒅𝒂(𝒋,π’Œ)= 𝒅𝒑(𝒋,π’Œ)=  !

Time quanta where 𝒄 tasks with higher priority are active tasks with higher priority are active Time quanta where tasks depending on j are active Time quanta where tasks depending on j are preempted

0123456789

π’•π’“π’Šπ’ˆπ’ˆπ’†π’“!

   π’‹πŸŽ!!    π’‹πŸ!!     π’‹β†“πŸ‘βŸ!    π’“πŸπŸ!!     π’‹β†“πŸβŸ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

π’π’π’„π’Œ!

𝒉𝒂,𝒅𝒂 and 𝒅𝒑 are defined and 𝒅𝒑 are defined are defined as sums of boolean variables: 𝒃𝒍(𝒋,π’Œ, π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)=𝒂𝒕(𝒋,π’Œ)≀𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)<𝒔𝒕(𝒋,π’Œ)

Page 17: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 17/19

Our work originates from the interaction we had with Kongsberg Maritime over several months

1. Can the input data of our COP (constants) be provided with reasonable effort? [2]

[2] Nejati, S., Di Alesio, S., Sabetzadeh, M., Briand, L.: Modeling and analysis of CPU usage in safety-critical embedded systems to support stress testing. In: Model Driven Engineering Languages and Systems, pp. 759–775. Springer (2012)

~25 man-hours

2. Can one use the output data of our COP (variables) to derive test cases?

Efficiency: time needed to generate test cases

Effectiveness: revealing power of worst-case scenarios

COP Constants

Variables

Objective Function

Constraints Search Heuristics

Page 18: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 18/19

We run our COP model for 5 hours recording every incumbent, one run for each objective function 𝑻=πŸ“πŸŽπŸŽ,    πŸ  π’•π’’=πŸπŸŽπ’Žπ’”,    π’„=πŸ‘ ~600 variables, 1 million constraints in IBM ILOG CPLEX CP Solver

1. Worst deadline miss: PushData, by 10 ms in three executions

2. Highest response time: 1200 ms 3. Highest CPU Usage: 32%

Page 19: Worst-Case Scheduling of Software Tasks

In summary, we showed how Constrained Optimization can support Performance Testing

The COP models the System Scheduler, Tasks, and Perf. Reqs.

The COP finds arrival times leading to worst-case scenarios β†’ test cases

Stefano Di Alesio - 19/19

Questions?  

We were able to generate test cases violating Perf. Reqs. in few minutes

Page 20: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 20/19

We developed a search heuristic to minimize backtracking during the branch and bound search

β–ˆβ– π’‚π’„(π’‹β†“πŸŽβŸ,   π’Œβ†“πŸŽβŸ, π’‘β†“πŸŽβŸ)∈[𝟎,𝟏] 𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)∈[𝟎,𝟏] 

β–ˆβ– π’‚π’„(π’‹β†“πŸŽβŸ,   π’Œβ†“πŸŽβŸ, π’‘β†“πŸŽβŸ)=𝟎 𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)∈[𝟎,𝟏] 

𝒂𝒄(π’‹β†“πŸŽβŸ,   π’Œβ†“πŸŽβŸ, π’‘β†“πŸŽβŸ)=𝟏 𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)∈[𝟎,𝟏]

𝒄=𝟏 𝒑𝒓(π’‹β†“πŸβŸ)>𝒑𝒓(π’‹β†“πŸŽβŸ) 𝒂𝒕(π’‹β†“πŸŽβŸ, π’Œβ†“πŸŽβŸ)=𝒂𝒕(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ)

Heuristic: First, assign the lowest value (𝟎) to 𝒂𝒄 for the highest priority task ) to 𝒂𝒄 for the highest priority task for the highest priority task

β–ˆβ– π’‚π’„(π’‹β†“πŸŽβŸ,   π’Œβ†“πŸŽβŸ, π’‘β†“πŸŽβŸ)=𝟎 𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)=𝟏 

𝒂𝒄(π’‹β†“πŸŽβŸ,   π’Œβ†“πŸŽβŸ, π’‘β†“πŸŽβŸ)=𝟏 𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)=𝟏

𝒂𝒄(π’‹β†“πŸŽβŸ,   π’Œβ†“πŸŽβŸ, π’‘β†“πŸŽβŸ)=𝟏 𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)=𝟎

β–ˆβ– π’‚π’„(π’‹β†“πŸŽβŸ,   π’Œβ†“πŸŽβŸ, π’‘β†“πŸŽβŸ)∈[𝟎,𝟏] 𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)∈[𝟎,𝟏]  β–ˆβ– π’‚π’„(π’‹β†“πŸŽβŸ,   π’Œβ†“πŸŽβŸ, π’‘β†“πŸŽβŸ)∈[𝟎,𝟏] 𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)=𝟎 

β–ˆβ– π’‚π’„(π’‹β†“πŸŽβŸ,   π’Œβ†“πŸŽβŸ, π’‘β†“πŸŽβŸ)=𝟎 𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)=𝟎 

𝒂𝒄(π’‹β†“πŸŽβŸ,   π’Œβ†“πŸŽβŸ, π’‘β†“πŸŽβŸ)=𝟏 𝒂𝒄(π’‹β†“πŸβŸ, π’Œβ†“πŸβŸ, π’‘β†“πŸβŸ)=𝟎

Page 21: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 21/19

Our case study is a monitoring application for fire/gas leaks detection in offshore platforms

Computing Hardware (Tri-core Processor)

Real Time Operating System (VxWorks)

Drivers (SW-HW Interface)

~100 Drivers * ~5 kLoC

Control Modules (Application Logic)

~5000 Modules * ~1 kLoC

Human Operators (Engineers)

External Hardware (Sensors + Actuators)

~500 devices

KM: Kongsberg Maritime FMS: Fire and gas Monitoring System

Page 22: Worst-Case Scheduling of Software Tasks

Stefano Di Alesio - 22/19

Drivers transfer data between external hardware (sensors and actuators) and control modules

PullData! Queue!IOBR!BoxIn! IOQW! IOQR! IOBW! BoxOut! PushData!

2.write! 3.check!

4.read!

5.trigger!

6.write! 7.check!

8.read!9.trigger!

10.write! 11.scan!

12.read!

External Hardware (Sensors + Actuators)

~500 devices

Control Modules (Application Logic)

~5000 Modules * ~1 kLoC

1.scan!

13.send!