More Related Content Similar to The Wizard of OS: a Heartbeat for Legacy Multimedia Applications (20) The Wizard of OS: a Heartbeat for Legacy Multimedia Applications1. RETIS Lab
Real-Time Systems Laboratory
7th IEEE Workshop on
Embedded Systems for Real-Time Multimedia
Grenoble, France
October, 15th – 16th, 2009
“The Wizard of OS: a Heartbeat for Legacy
Multimedia Applications”
Tommaso Cucinotta, Fabio Checconi Luca Abeni, Luigi Palopoli
RealTime Systems Laboratory University of Trento
Scuola Superiore Sant'Anna
© 2008 Scuola Superiore Sant’Anna
2. Motivations
GeneralPurpose 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
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
3. Motivations
Overcoming 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
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
4. Motivations
Recent 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 ?
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
5. Research objectives
This research aims to
Allow legacy realtime applications to benefit of realtime
scheduling facilities available on a GPOS
Without any change in the application sourcecode
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
6. Proposed approach
Proposed 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
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
7. Proposed approach
Comprehensive view
Application tracing
Period estimation (events analysis)
Online WCET estimation
Automagic provisioning of
scheduling guarantees
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
8. Realtime theory
Reservationbased scheduling: (Q, P)
Known results from the realtime theory
Not all (Q, P) with
a given Q/P are
equal
Highlighted by the
supplybound
function shown
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
10. Core problem
How to detect the application period ?
Of a legacy realtime application (no sourcecode
availability, no modifications)
Proposed approach
Tracing the application behaviour at runtime
For the purpose of identifying “periodicity patterns”
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
11. Legacy application tracing
Tracing 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 systemcall tracing
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
12. Legacy application tracing
Available 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 qostrace
A lowoverhead systemcall tracer based on ptrace()
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
14. Heuristic
Identification of local peaks
Selection of candidate peaks
(sensibly higher than average)
Perform a weighted linear regression
among the candidate peaks
The peak closest to the regression
line inclination coefficient wins
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
15. Experimental results
Setup
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 metrics
InterFrame time
Allocated bandwidth
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
18. The bill
What it costs (tracing overhead)
When using strace: +4,8%
When using qostrace: +2,75%
42% overhead reduction with the custom tracer
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
19. Future work
Reducing further the tracing overhead
Kernellevel tracer
Period detection heuristic
More comprehensive evaluation
Precision with respect to available parameters
Improvements for enhanced precision and reduced
overhead
Facing with multithread applications
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore
20. Thanks for your attention
Questions ?
Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna
© 2007 Scuola Superiore