1 / 15

Tiny OS Optimistic Lightweight Interrupt Handler

Tiny OS Optimistic Lightweight Interrupt Handler. Simon Yau (smyau@cs.berkeley.edu) Alan Shieh (ashieh@hkn.eecs.berkeley.edu). Tiny OS Overview. Small footprint system Used in small, low-power, embedded devices (e.g., temperature sensors) Event-based programming model. Tiny OS Primer.

skyler-lane
Download Presentation

Tiny OS Optimistic Lightweight Interrupt Handler

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. Tiny OS Optimistic Lightweight Interrupt Handler Simon Yau (smyau@cs.berkeley.edu) Alan Shieh (ashieh@hkn.eecs.berkeley.edu)

  2. Tiny OS Overview • Small footprint system • Used in small, low-power, embedded devices (e.g., temperature sensors) • Event-based programming model

  3. Tiny OS Primer • Program consist of state machines • All threads run to completion, unless preempted by hardware events • Event filtering Radio Tran- ceiver Radio Bit Radio Byte Packet Object Active Mess- age Applic- ation

  4. Interrupt Handling in Tiny OS • Context switch during interrupts are most expensive primitive • Interrupt lost is power lost

  5. A Bag of tricks: • Software simulated register window • Lightweight Interrupt handler • Optimistic (Lazy) interrrupt handler

  6. Software Register Window • Register windows useful for low-overhead interrupt handling • Providing this support in hardware may not be cost-effective • Additional area can be used for other I/O optimizations

  7. Software Register Window (implementation) • Two versions of gcc • User-mode and Interrupt-mode gcc • Each allowed to use approximately half of register file • Calling conventions restricted • Post-compilation function rename

  8. Software Register Window Shared registers User registers Interrupt registers

  9. Lightweight Interrupt Handler • Software Simulated register windows means less registers to work with => more register spills • Want a handler that is Lightweight • Consumes less register (reduce register spills) • Lower execution time (reduce lost interrupts)

  10. Lightweight IH (implementation) • The IH does not fire off an event, but rather posts a thread that does. • We can vary the amount of filtering where this is done.

  11. Lazy Interrupt Handler • Most of the time the CPU is in sleep mode (I.e., has no thread running). • In those cases, saving register is unnecessary. • Set aside a register for sleep mode, and check it during interrupts.

  12. Evaluation environment • Simulated CPU, with Radio, LED, and Photo sensor. • Benchmarks • Single processor simulation • Network simulation • Measure: • Number of cycles in sleep / active mode • Energy consumption • Number of cycles with interrupts disabled • Number of lost interrupts

  13. Evaluation • Register window • Radio interrupt is now 113 cycles (down from 165) • But improvement is unstable because asymmetry of register set increases register pressure

  14. Evaluation (cont) • Lightweight Handler • Reduces execution time of Timer Interrupt handler by 57%; Radio Interrupt handler by 33%. But added thread posting/scheduling overhead for event handler. • Bad for radio interrupt due to real time constrains and the overhead. • Benchmark performance…

  15. Evaluation (cont) • Lazy Interrupt handler • Reduces a typical radio interrupt from 165 cycles to 114 cycles • On the bench mark…

More Related