1 / 23

Evolving Real-Time Systems using Hierarchical Scheduling and Concurrency Analysis

Evolving Real-Time Systems using Hierarchical Scheduling and Concurrency Analysis. John Regehr Alastair Reid Kirk Webb Michael Parker Jay Lepreau School of Computing, University of Utah. Problem: Evolving real-time and embedded software is hard

dezso
Download Presentation

Evolving Real-Time Systems using Hierarchical Scheduling and Concurrency Analysis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Evolving Real-Time Systemsusing Hierarchical Schedulingand Concurrency Analysis John Regehr Alastair Reid Kirk Webb Michael Parker Jay Lepreau School of Computing, University of Utah

  2. Problem: Evolving real-time and embedded software is hard • Problem: Concurrent software is hard to write and debug • Problem: Traditional task models ignore some important details about real systems

  3. hi FIFO CPU FIFO lo thread A Task Set t1 hi t2 IRQ t3 lo t4 t5 hi t6 t7 t8 lo Key: preemptive non-preemptive

  4. This Talk • Introduces hierarchical execution environments to support analysis of: • Concurrency • Response times • Blocking terms • Dispatch overheads • Results in solving real-time problems on sensor network nodes

  5. Execution Environments • A real-time or embedded system usually supports multiple execution environments • Interrupts • Bottom-half handlers • a.k.a. DPCs, tasklets, deferred handlers • Event handlers • Kernel threads • User threads

  6. An Execution Environment… • Occupies a place in the scheduling hierarchy • Has particular performance characteristics • Has rules: • About actions code running in it may take • About how to synchronize with code in other environments

  7. Related Work • Hierarchical scheduling • Lots of work: Deng et al., Feng & Mok, Lipari et al., Regehr & Stankovic, Saewong et al., Shin & Lee, … • Multiple execution environments • Limited related work here • Concurrency analysis • Lots of work in PL and formal methods communities – but none supporting multiple execution environments

  8. Goal: Evolving Systems • Often desirable to move code between environments • “Promote” code to a higher priority environment • “Demote” code to a lower priority environment • Problem: How do we know when to promote / demote code? • Problem: Very easy to introduce concurrency errors this way • May be lots of code per environment

  9. Example System: Motes • Sensor network nodes • Software based on TinyOS • Very simple “OS” • No threads! • Motes are resource constrained • 4 MHz 8-bit RISC • 4 KB SRAM, 128 KB flash

  10. Problem 1: Long-running tasks cause network errors int1 hi int2 IRQ hi int3 lo CPU calc_crc lo sent FIFO received encrypt Key: preemptive non-preemptive decrypt

  11. Fixed TinyOS 1 int1 hi int2 IRQ hi int3 lo calc_crc CPU sent FIFO1 hi lo received AvrX encrypt lo FIFO2 decrypt Key: preemptive non-preemptive

  12. Results

  13. Problem 2: Missed SPI deadlines cause packet loss timer hi SPI IRQ hi UART lo CPU t1 lo t2 FIFO t3 t4 Key: preemptive non-preemptive

  14. Fixed TinyOS 2 SPI timer hi hi soft_SPI IRQ vIRQ hi lo UART lo CPU t1 lo t2 FIFO t3 t4 Key: preemptive non-preemptive

  15. Results

  16. Problem: How do we know when to promote / demote code? • Solution: Response time analysis • Problem: Very easy to introduce concurrency errors this way • Solution: Concurrency analysis

  17. Real-Time Analysis • Problem: How to analyze response times for hierarchies? • Solution: Map to a problem that we know how to solve • Static priority scheduling • Preemption threshold scheduling • Hierarchies restricted to: • Preemptive priority schedulers • Leaf schedulers can be non-preemptive FIFO or priority

  18. Real-Time Analysis 5 us (0,0) clock hi 2 us (1,1) disk IRQ (2,2) disk_bh hi lo FIFO (2,2) eth_bh CPU lo e1 (4,4) t1 (3,3) event e2 (5,4) thread e3 (6,4) t3 (7,7) Key: preemptive non-preemptive 10 us 2 us

  19. Concurrency Analysis • Problem: How to check for race conditions? • Solution: Task scheduler logic • Static analysis of concurrency across a hierarchy of execution environments

  20. Task Scheduler Logic • Schedulers specify: • Preemption relations among things they schedule • Locks they provide • Axioms propagate effects around the hierarchy • TSL allows us to derive (potential) preemption relations for each pair of tasks in a system • Details in paper…

  21. Concurrency Analysis clock hi disk IRQ disk_bh hi lo FIFO eth_bh CPU lo e1 t1 event e2 thread e3 t3 Key: preemptive non-preemptive

  22. Contributions • New notation for describing structure of systems software • Heuristics for evolving systems • Algorithms for hierarchical priority and FIFO schedulers: • Whole-program concurrency analysis • Response time analysis • Experimental validation

  23. Evolving Real-Time Systemsusing Hierarchical Schedulingand Concurrency Analysis John Regehr Alastair Reid Kirk Webb Michael Parker Jay Lepreau School of Computing, University of Utah

More Related