Successfully reported this slideshow.

The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

466 views

Published on

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.

  • Be the first to comment

  • Be the first to like this

The Wizard of OS: a Heartbeat for Legacy Multimedia Applications

  1. 1. 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  Real­Time Systems Laboratory University of Trento Scuola Superiore Sant'Anna © 2008 Scuola Superiore Sant’Anna
  2. 2. Motivations General­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 Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  3. 3. Motivations Overcoming 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 Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  4. 4. Motivations Recent 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 ? Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  5. 5. Research objectives This 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 Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  6. 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 real­time theory Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  7. 7. Proposed approach Comprehensive view  Application tracing  Period estimation (events analysis)  On­line WCET estimation  Automagic provisioning of  scheduling guarantees Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  8. 8. Real­time theory Reservation­based scheduling: (Q, P) Known results from the real­time theory  Not all (Q, P) with a given Q/P are equal  Highlighted by the supply­bound function shown Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  9. 9. Real­time theory What are the reservation  parameters needed for  correctly scheduling a real­ time periodic task with  assigned WCET and period ? The minimum reservation  utilization is achieved  when the reservation period  equals the task period • or any integer sub­ multiple Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  10. 10. Core problem How to detect the application period ?  Of a legacy real­time application (no source­code  availability, no modifications) Proposed approach  Tracing the application behaviour at run­time  For the purpose of identifying “periodicity patterns” Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  11. 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 system­call tracing Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  12. 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 low­overhead system­call tracer based on ptrace() Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  13. 13. Period detection The tracer produces a sequence of time­stamps Time­stamps used to compute a Fourier­transform A heuristic catches the first harmonic Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  14. 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. 15. Experimental results Set­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 metrics  Inter­Frame time  Allocated bandwidth Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  16. 16. Experimental results Inter­Frame times Cumulative Distribution Function Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  17. 17. Experimental results Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  18. 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. 19. Future work Reducing further the tracing overhead  Kernel­level tracer Period detection heuristic  More comprehensive evaluation  Precision with respect to available parameters  Improvements for enhanced precision and reduced  overhead  Facing with multi­thread applications Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore
  20. 20. Thanks for your attention Questions ? Tommaso Cucinotta – Real Time Systems Laboratory (ReTiS) – Scuola Superiore Sant'Anna Sant’Anna © 2007 Scuola Superiore

×