22
RTOS support for mixed time-triggered and event-triggered task sets Martijn van den Heuvel, R.J. Bril, J.J. Lukkien, D. Isovic G. Sankar Ramachandran Thanks to: Syed M.J. Abdullah and Xiaodi Zhang IEEE/IFIP Embedded and Ubiquitous Computing (EUC) 2012

RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

RTOS support for

mixed time-triggered and

event-triggered task sets

Martijn van den Heuvel,

R.J. Bril, J.J. Lukkien, D. Isovic

G. Sankar Ramachandran

Thanks to:

Syed M.J. Abdullah and Xiaodi Zhang

IEEE/IFIP Embedded and Ubiquitous Computing (EUC) 2012

Page 2: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Complexity of industrial applications

/ Mathematics and computer science PAGE 1 6-12-2012

Efficient resource usage vs. complex constraints

Page 3: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Task model

/ Mathematics and computer science PAGE 2 6-12-2012

Periodic task ( Pi )

Sporadic task ( Si )

A-periodic task ( Ai )

• Tasks

• Job

• Relative deadline = D

• Absolute deadline = arrival time +D

Preemptive EDF scheduling: based on absolute deadline

Arrival time di,k

job

D

Event-triggered:

Time-triggered:

Page 4: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

How slotshifting works?

/ Mathematics and computer science PAGE 3 6-12-2012

[Isovic and Fohler, RTSJ 2009]

Page 5: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

/ Mathematics and computer science PAGE 4 6-12-2012

Creating the off-line schedule (1/2)

• Offline reservation of periodic tasks into intervals

• Divide an interval into reserved capacity and spare

capacity

P1

P3P2

Periodic tasks

spare capacityreserved capacity

length of the interval

1 2 4 5 6 7 8 9 10 113

P3

0 12

P1 P2

I0 I1

Page 6: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

/ Mathematics and computer science PAGE 5 6-12-2012

Creating the off-line schedule (2/2)

• reserved capacity of an interval:

• Periodic tasks requiring more capacity must execute

in an earlier interval

+

Periodic

jobs

reserved

1 5 6 7 8 9 10 112 43

P3

0 12

P1 P2

reserved capacity (I0)

reserved capacity (I1)

Periodic jobs

of later intervals

Page 7: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

How slotshifting works?

/ Mathematics and computer science PAGE 6 6-12-2012

[Isovic and Fohler, RTSJ 2009]

Page 8: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

/ Mathematics and computer science PAGE 7 6-12-2012

Off-line test for sporadic tasks

Schedulability test of sporadic tasks

• Classical demand-based analysis

• Supply by slotshifting (spare capacity)

Demand

during an interval of length L L≤ [Baruah

RTSS06]

Demand

during an interval of length L≤

supply based on slotshifting

Supply

during an interval of length L

Page 9: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

How slot-shifting works?

/Mathematics and computer science PAGE 8 6-12-2012

[Isovic and Fohler, RTSJ 2009]

Page 10: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

How slot-shifting works?

/Mathematics and computer science PAGE 9 6-12-2012

[Isovic and Fohler, RTSJ 2009]

Page 11: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Extending a commercial RTOS

• MicroC/OS-II is

Event-driven fixed-priority scheduling

Available at http://micrium.com/

• We extended MicroC/OS-II with

Time-keeping for time-triggered tasks

WCET monitoring

EDF scheduler

Admission control (accounting spare time)

/Mathematics and computer science PAGE 10 6-12-2012

Page 12: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Extending a commercial RTOS

• MicroC/OS-II is

Event-driven fixed-priority scheduling

Available at http://micrium.com/

• We extended MicroC/OS-II with

Time-keeping for time-triggered tasks

See paper for pseudo-code

WCET monitoring

EDF scheduler

Admission control (accounting spare time)

/Mathematics and computer science PAGE 11 6-12-2012

Page 13: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Extending a commercial RTOS

• MicroC/OS-II is

Event-driven fixed-priority scheduling

Available at http://micrium.com/

• We extended MicroC/OS-II with

Time-keeping for time-triggered tasks

EDF scheduler

WCET monitoring

Admission control (accounting spare time)

/Mathematics and computer science PAGE 12 6-12-2012

Page 14: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

WCET monitoring

• System queue with absolute deadlines

• A virtual interval timer to track WCETs

(De)Activate upon context switch

• Timer expirations require overload handling

[1] Van den Heuvel et al., Transparent Synchronization Protocols for

Compositional Real-Time Systems, IEEE Trans. Industrial Informatics, May 2012

/Mathematics and computer science PAGE 13 6-12-2012

Page 15: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Extending a commercial RTOS

• MicroC/OS-II is

Event-driven fixed-priority scheduling

Available at http://micrium.com/

• We extended MicroC/OS-II with

Time-keeping for time-triggered tasks

WCET monitoring

EDF scheduler

Admission control (accounting spare time)

/Mathematics and computer science PAGE 14 6-12-2012

Page 16: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Implementation complexity

Efficiency of monitoring spare capacities:

“executing a periodic task in an other interval

than designated swaps spare capacities.”

Updating spare capacities may propagate

through the entire hyper period…

/Mathematics and computer science PAGE 15 6-12-2012

1 5 6 7 8 9 10 112 43

P3

0 12

P1 P2

reserved capacity (I0)

reserved capacity (I1)

Page 17: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Handling a-periodic requests

Trade-off:

estimated spare capacities vs.

exact spare capacity.

Hard real-time a-periodic tasks:

Pseudo-polynomial test.

Reserve time for the admission control itself

(sporadic server)

Soft real-time tasks run in the background

/Mathematics and computer science PAGE 16 6-12-2012

Page 18: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Extending a commercial RTOS

• MicroC/OS-II is

Event-driven fixed-priority scheduling

Available at http://micrium.com/

• We extended MicroC/OS-II with

Time-keeping for time-triggered tasks

WCET monitoring

EDF scheduler

Admission control (accounting spare time)

/Mathematics and computer science PAGE 17 6-12-2012

Page 19: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Evaluation

• Overheads of event-handling and accounting

Worst-case Off-line scheduled

/Mathematics and computer science PAGE 18 6-12-2012

Page 20: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Recorded example

• Instrumentation of MicroC/OS-II

• Synthetic workload

[2] Holenderski et al., Grasp: Tracing, Visualizing and Measuring the Behavior of

Real-Time Systems, WATERS, July 2010

/Mathematics and computer science PAGE 19 6-12-2012

Borrowing

and lending

Resource

reclaiming

Page 21: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Summary

• Implementation of slotshifting in µC/OS-II:

• Handles task sets with mixed real-time behavior

• Modular run-time mechanisms

• Performance evaluation of RTOS overheads

/Mathematics and computer science PAGE 20 6-12-2012

Page 22: RTOS support for mixed time-triggered and event-triggered ... · How slot-shifting works? /Mathematics and computer science 6-12-2012 PAGE 8 [Isovic and Fohler, RTSJ 2009] How slot-shifting

Future work

• Future work

• Resource sharing between sporadic and periodic tasks

/ Mathematics and computer science PAGE 21 6-12-2012

New offline analysis + New online scheduling mechanism