temporal reflection and reflective scheduling for the l4
play

Temporal reflection and reflective scheduling for the L4 microkernel - PowerPoint PPT Presentation

Temporal reflection and reflective scheduling for the L4 microkernel WIRTES workshop - Pisa, 2 July 2007 Sergio Ruocco ruocco@disco.unimib.it Nomadis mobile systems Lab. Universit degli Studi di Milano-Bicocca Research overview Feb 2004


  1. Temporal reflection and reflective scheduling for the L4 microkernel WIRTES workshop - Pisa, 2 July 2007 Sergio Ruocco ruocco@disco.unimib.it Nomadis mobile systems Lab. Università degli Studi di Milano-Bicocca

  2. Research overview Feb 2004 PhD Temporal Reflection, Univ. di Milano-Bicocca Apr 2004 – Apr 07 NICTA ERTOS Researcher, Sydney, Australia L4 microkernel - temporal reflection and reflective scheduling [RTSS06] - from real-fast to real-time [OSPERT06, OSPERT07] Apr. 2007 – now Nomadis Lab. Research Fellow Università di Milano-Bicocca IMUD project: Inertial Monitoring Unit Device Research areas: – Temporal reflection and reflective real-time scheduling – non-functional / quality requirements: energy & power management – SMT/SMP real-time scheduling – L4 and Linux-based embedded real-time systems – sw engineering for device drivers, ... 2

  3. Schedules embed assumptions Real-time schedules embed assumptions on: task A release WCET deadline CPU speed RAM speed input data IO speed task inter-dependencies etc. 3

  4. Schedules embed assumptions Real-time schedules embed assumptions on: task A } release WCET deadline CPU speed RAM speed input data assumptions can fail! IO speed task inter-dependencies etc. 4

  5. ...assumptions can fail ! task A release WCET deadline violation 5

  6. ...assumptions can fail ! task A release WCET deadline violation task B task task A task 6

  7. How to adapt ? Depends on the fault ! task A release WCET deadline ?? violation task B task task A task ?? task A task task C / IO 7

  8. Computational Reflection Brian Cantwell Smith: A reflective system is a computer system able to reason about itself. Reflection and Semantics in a Procedural Language. TR 272, MIT LCS (1982) A reflective system embeds a suitable representation of itself . Such self-representation is causally-connected with the system itself. 8

  9. Reflective scheduler actions Strategist actual duration planned execution interval now() past future T Time-driven Execution Engine System temporal behaviour ↔ object of the system - fine-grained adaptive control of behaviour (...and many other things we don't have time to talk about...) 9

  10. Temporal reflection Temporal reflection Application – observe & control the system temporal + strategist behavior as an object of the system itself. – i.e., executes observes & manipulates – – The real-time system becomes aware of Reflective sched. real-time and its own behaviour. + TDE – OS Kernel Causal-connection CPU / Hardware Sergio Ruocco, Temporal Reflection (PhD Thesis), 2004 – 10

  11. Nice, but... Pragmatic application (one of many...): Adaptive real-time scheduling in resource-constrained systems – fine-grained adaptation exploiting application-specific information – feedback control loop detects faults and corrects future behaviour – difficult to do with ordinary schedulers — no accurate data on faults Case study: – real-time adaptive video analysis Experimental results: – user-level implementation – ...on unmodified L4 microkernel on ARM XScale 400 MHz – microsecond -level precision & accuracy – – ... (much more in the paper, RTSS'06 ) 11

  12. Adaptive video analysis Problem: decode MPEG stream & search for a lightning before the next frame is due. 12

  13. Application actions Application strategist /* C functions implement the application functional requirements */ executes observes & void mpeg2_read_action () { manipulates size = fread (buffer, 1, BUFFER_SIZE, mpgfile); mpeg2_buffer (decoder, buffer, buffer + size); } Reflective sch. void mpeg2_parse_action () { + TDE mpeg2_parse_state = mpeg2_parse (decoder); } void analyze_action () { rectangle_rgb (info->sequence->width, info->sequence- >height, video_buffer, BRIGHTNESS_TRESHOLD, dx, dy); } OS Kernel void display_action () { video_buffer.display() // display the frame } CPU / Hardware 13

  14. Read() from stream... phase1: decoding Application read_action() 14

  15. Strategist actions phase1: decoding Strategist: handle_read() 15

  16. Strategist actions Application + strategist /* C functions implement * temporal requirements executes observes & * i.e., observe and compute manipulates * the system's temporal behaviour */ Reflective sch. int handle_read() { + TDE if (size != 0) { now = lltimer_now_usec(clock); plan_parse (now, now + PARSE_LEN); } } OS Kernel CPU / Hardware 16

  17. Adaptive video analysis plan phase1: decoding Application parse_action() 17

  18. Strategist actions phase1: decoding Strategist: handle_parse() 18

  19. Strategist actions Application + strategist /* C functions implement temporal requirements * i.e., compute the system's temporal behaviour */ executes observes & manipulates int handle_parse() { switch ( mpeg2_parse_state ) { Reflective sch. case STATE_FRAME_READY: { + TDE framenum++; // compute frame display time when = first_frame_time + (framenum-1) * frame_interval[framerate]; // plan display even if 'when' is past 'now' // (i.e., missed deadline!) OS Kernel newa = plan_display (when,when + DISPLAY_LEN)) ... /* ... plan_analysis() ... */ } CPU / Hardware 19

  20. Display is planned, but analysis ? phase 2: analysis Strategist: handle_parse() 20

  21. Adaptive analysis planning phase 2: analysis Strategist: handle_parse() time available for analysis unknown until frame ready 21

  22. Adaptive real-time video analysis Subsampling graduates frame analysis duration 22

  23. Table for adaptive scheduling display accuracy / jitter (controlled variable) Frame Analysis length Dx Dy Quality (1/dxdy) 16 15211 1 1 1 18 7373 1 2 1 / 2 0 (no data) 1 3 1 / 3 0 (no data) 2 2 1 / 4 0 (no data) 2 3 1 / 6 23

  24. Strategist: adaptation tactic handle_parse() { Application .... strategist newa = plan_display (when, when + DISPLAY_LEN))) now = lltimer_now_usec(clock); // refresh 'now' avail_time = when - now; // avail.time for analysis executes observes & adapt_table manipulates 10 15211 12 7373 if ((avail_time > 0) && Reflective sched. 35 n/a ( + TDE lookup (adapt_table,ADAPT_TABLE_SIZE,avail_time,&dx,&dy)) ) { // sets analysis quality in dx/dy, // based on the available time newa = plan_analyze (now, now + ANALYZE_LEN); OS Kernel } handle_analyse() { update_adaptive_table (adaptive_table, CPU / Hardware a->actual.end.usec - a->actual.start.usec, dx, dy, a->frameno); } 24

  25. Experimental results • [ Feedback calibration: source code + graph ] 25

  26. Adaptive tuning of display instant Application strategist handle_display (struct Action * a) { error = a->actual.start.raw.raw32 – a- executes observes & >planned.start.raw.raw32; manipulates newcal = - (error) / 2 + oldcal; // feedback correction lltimer_set_calibration (clock, newcal); Reflective sched. } + TDE OS Kernel CPU / Hardware 26

  27. Experimental results 27

  28. Thanks 28

  29. References [OSPERT07] Kevin Elphinstone, David Greenaway and Sergio Ruocco, Lazy Scheduling and Direct Process Switch - Merit or Myths?, Proc. of the 2007 Workshop on Operating Systems Platforms for Embedded Real-Time applications, Pisa, Italy, July 2007. [RTSS06] Sergio Ruocco, User-Level Fine-Grained Adaptive Real-Time Scheduling via Temporal Reflection, Proceedings of 27th IEEE Real-time Systems Symposium, Rio de Janeiro, Brazil, Dec 2006. [OSPERT06] Sergio Ruocco, Real-time Programming and L4 Microkernels, Proc. of 2006 Workshop on Operating Systems Platforms for Embedded Real- Time applications, Dresden, Germany, July 2006 [ISORC04] Micucci, D. and Ruocco, S. and Tisato, F. and Trentini, A., Time Sensitive Architectures: a Reflective Approach, Proc. of 7th International Symposium on Object-oriented Real-time distributed Computing, Wien, Austria, May 2004. [Ruo04] Sergio Ruocco, Temporal Reflection (PhD Thesis), Università degli Studi di Milano, Milano, Italy, February 2004 29

  30. Thanks 30

Recommend


More recommend