The Wizard of OS: a Heartbeat for Legacy Multimedia Applications
-
Upload
tcucinotta -
Category
Documents
-
view
276 -
download
0
description
Transcript of 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 ChecconiRealTime 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
© 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
GeneralPurpose Operating SystemsGeneralPurpose Operating Systems
Very effective for storing & managing multimedia contents
Designed for
• averagecase performance
• serving applications on a besteffort basis
They are not the best candidate for serving realtime
applications with tight timing constraints
• nor for realtime multimedia
© 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 realtime interaction nor lowlatency multimedia
Oneapplication onesystem paradigm
• For example, for lowlatency realtime audio processing (jack),
gaming, CD/DVD burning, etc...
POSIX realtime extensions
• Prioritybased, no temporal isolation
• Not appropriate for deploying the multitude of (soft) realtime
applications populating the systems of tomorrow
© 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
EDFbased realtime 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 sourcecode level
What about 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 realtime applications to benefit of realtime
scheduling facilities available on a GPOS
Without any change in the application sourcecode
© 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 realtime theory
© 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)
Online WCET estimation
Automagic provisioning of
scheduling guarantees
© 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
Realtime theoryRealtime theory
Reservationbased scheduling: (Q, P)Reservationbased scheduling: (Q, P)Known results from the realtime theoryKnown results from the realtime theory
Not all (Q, P) with
a given Q/P are
equal
Highlighted by the
supplybound
function shown
© 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
Realtime theoryRealtime theory
What are the reservation What are the reservation parameters needed for parameters needed for correctly scheduling a realcorrectly scheduling a realtime 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
© 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 realtime application (no sourcecode
availability, no modifications)
Proposed approachProposed approach
Tracing the application behaviour at runtime
For the purpose of identifying “periodicity patterns”
© 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 systemcall tracingsystemcall tracing
© 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 lowoverhead systemcall tracer based on ptrace()
© 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 timestampstimestamps
Timestamps used to compute a Timestamps used to compute a FouriertransformFouriertransform
A A heuristicheuristic catches the catches the first harmonicfirst harmonic
© 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
© 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
SetupSetup
Linux OS, with an implementation of the CBS scheduler
Feedbackscheduling by means of LFS (prior paper)
Custom video player, using libavformat/libavcodec
• modified to monitor the InterFrame time
Application tracing by using qostrace
Validation metricsValidation metrics
InterFrame time
Allocated bandwidth
© 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
InterFrame times Cumulative Distribution FunctionInterFrame times Cumulative Distribution Function
© 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
© 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
© 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
Kernellevel tracer
Period detection heuristicPeriod detection heuristic
More comprehensive evaluation
Precision with respect to available parameters
Improvements for enhanced precision and reduced
overhead
Facing with multithread 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 ?