the wizard of os: a heartbeat for legacy multimedia applications

20
© 2008 Scuola Superiore Sant’Anna “The Wizard of OS: a Heartbeat for Legacy         Multimedia Applications” Real-Time Systems Laboratory RETIS Lab Tommaso Cucinotta, Fabio Checconi Real-Time Systems Laboratory Scuola Superiore Sant'Anna 7 th IEEE Workshop on Embedded Systems for Real-Time Multimedia Grenoble, France October, 15 th – 16 th , 2009 Luca Abeni, Luigi Palopoli University of Trento

Upload: tcucinotta

Post on 11-Jun-2015

275 views

Category:

Documents


0 download

DESCRIPTION

This presentation describes a technique for automagic provisioning of real-time scheduling guarantees for legacy multimedia applications, that does not require any modification to the application source-code.

TRANSCRIPT

Page 1: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2008 Scuola Superiore Sant’Anna

“The Wizard of OS: a Heartbeat for Legacy        Multimedia Applications”

Real-Time Systems Laboratory

RETIS Lab

Tommaso Cucinotta, Fabio ChecconiReal­Time Systems Laboratory

Scuola Superiore Sant'Anna

7th IEEE Workshop onEmbedded Systems for Real-Time Multimedia

Grenoble, FranceOctober, 15th – 16th, 2009

Luca Abeni, Luigi Palopoli University of Trento

Page 2: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

MotivationsMotivations

General­Purpose Operating SystemsGeneral­Purpose Operating Systems

Very effective for storing & managing multimedia contents

Designed for

• average­case performance

• serving applications on a best­effort basis

They are not the best candidate for serving real­time 

applications with tight timing constraints

• nor for real­time multimedia

Page 3: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

MotivationsMotivations

Overcoming limitations of a GPOS for multimediaOvercoming limitations of a GPOS for multimedia

Large buffers used to compensate unpredictability

• ==> no real­time interaction nor low­latency multimedia

One­application one­system paradigm

• For example, for low­latency real­time audio processing (jack), 

gaming, CD/DVD burning, etc...

POSIX real­time extensions

• Priority­based, no temporal isolation

• Not appropriate for deploying the multitude of (soft) real­time 

applications populating the systems of tomorrow

Page 4: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

MotivationsMotivations

Recent developments in GPOS schedulingRecent developments in GPOS scheduling

EDF­based real­time scheduling with temporal isolation

• Better utilization of resources

• Independent applications are isolated from the temporal perspective

Various APIs for accessing the enhanced functionality

• For example, the FRSH API from

• For example, the API from 

They require modifications of the applications

• at the source­code level

What about legacy multimedia applications ?

Page 5: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Research objectivesResearch objectives

This research aims toThis research aims to

Allow legacy real­time applications to benefit of real­time 

scheduling facilities available on a GPOS

Without any change in the application source­code

Page 6: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Proposed approachProposed approach

Proposed approachProposed approach

An appropriate tracing mechanism observes the 

application, inferring main parameters affecting a (periodic) 

multimedia application temporal behaviour:

• job execution time

• period

Scheduling guarantees are automagically provisioned by 

the OS, according to proper scheduling parameters

• Based on sound arguments from real­time theory

Page 7: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Proposed approachProposed approach

Comprehensive viewComprehensive view

Application tracing

Period estimation (events analysis)

On­line WCET estimation

Automagic provisioning of 

scheduling guarantees

Page 8: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Real­time theoryReal­time theory

Reservation­based scheduling: (Q, P)Reservation­based scheduling: (Q, P)Known results from the real­time theoryKnown results from the real­time theory

Not all (Q, P) with

a given Q/P are

equal

Highlighted by the

supply­bound

function shown

Page 9: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Real­time theoryReal­time theory

What are the reservation What are the reservation parameters needed for parameters needed for correctly scheduling a real­correctly scheduling a real­time periodic task with time periodic task with assigned WCET and period ?assigned WCET and period ?

The The minimumminimum reservation  reservation utilization is achievedutilization is achieved

when the reservation period 

equals the task period

• or any integer sub­

multiple

Page 10: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Core problemCore problem

How to detect the application period ?How to detect the application period ?

Of a legacy real­time application (no source­code 

availability, no modifications)

Proposed approachProposed approach

Tracing the application behaviour at run­time

For the purpose of identifying “periodicity patterns”

Page 11: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Legacy application tracingLegacy application tracing

Tracing legacy multimedia applicationTracing legacy multimedia application

Tracing what the application does

• What system calls it periodically calls

– Waiting, reading time information, posting timers, disk 

operations, network operations, etc...

Tracing how the application behaves temporally

• When it suspends and resumes

Results obtained with Results obtained with system­call tracingsystem­call tracing

Page 12: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Legacy application tracingLegacy application tracing

Available mechanismsAvailable mechanisms

strace Linux utility

• Designed as debugging helper, too much overhead due to the 

generation of unneeded data

ptrace() system call

• Allows an external process to trace the execution of a target 

process, forcing it to stop at each entry and exit of a system call

We developed We developed qostraceqostrace

A low­overhead system­call tracer based on ptrace()

Page 13: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Period detectionPeriod detection

The tracer produces a sequence of The tracer produces a sequence of time­stampstime­stamps

Time­stamps used to compute a Time­stamps used to compute a Fourier­transformFourier­transform

A A heuristicheuristic catches the  catches the first harmonicfirst harmonic

Page 14: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

HeuristicHeuristic

Identification of local peaksIdentification of local peaks

Selection of candidate peaksSelection of candidate peaks(sensibly higher than average)(sensibly higher than average)

Perform a weighted linear regression Perform a weighted linear regression among the candidate peaksamong the candidate peaks

The peak closest to the regression The peak closest to the regression line inclination coefficient winsline inclination coefficient wins

Page 15: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Experimental resultsExperimental results

Set­upSet­up

Linux OS, with an implementation of the CBS scheduler

Feedback­scheduling by means of LFS (prior paper)

Custom video player, using libavformat/libavcodec

• modified to monitor the Inter­Frame time

Application tracing by using qostrace

Validation metricsValidation metrics

Inter­Frame time

Allocated bandwidth

Page 16: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Experimental resultsExperimental results

Inter­Frame times Cumulative Distribution FunctionInter­Frame times Cumulative Distribution Function

Page 17: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Experimental resultsExperimental results

Page 18: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

The billThe bill

What it costs (tracing overhead)What it costs (tracing overhead)

When using strace: +4,8%

When using qostrace: +2,75%

42% overhead reduction with the custom tracer

Page 19: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Future workFuture work

Reducing further the tracing overheadReducing further the tracing overhead

Kernel­level tracer

Period detection heuristicPeriod detection heuristic

More comprehensive evaluation

Precision with respect to available parameters

Improvements for enhanced precision and reduced 

overhead

Facing with multi­thread applications

Page 20: The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

© 2007 Scuola Superiore Sant’Anna Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'AnnaTommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna

Thanks for your attentionThanks for your attention

Questions ?Questions ?