1 / 48

Tracking Energy in Networked Embedded Systems

Tracking Energy in Networked Embedded Systems. Rodrigo Fonseca † *, Prabal Dutta † , Philip Levis ‡ , Ion Stoica †. Computer Science Division † University of California, Berkeley {prabal,istoica}@cs.berkeley.edu. Yahoo! Research * Santa Clara, CA rfonseca@yahoo-inc.com.

denverl
Download Presentation

Tracking Energy in Networked Embedded Systems

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. Tracking Energy in Networked Embedded Systems Rodrigo Fonseca†*, Prabal Dutta†, Philip Levis‡, Ion Stoica† Computer Science Division† University of California, Berkeley {prabal,istoica}@cs.berkeley.edu Yahoo! Research* Santa Clara, CA rfonseca@yahoo-inc.com Computer Science Department‡ Stanford University pal@cs.stanford.edu OSDI’08 – San Diego, California – Dec. 8-10, 2008

  2. Motivation:in mote-class sensor networks, energy is the defining constraint • Wide dynamic range • 10 mA active current • 10 uA sleep current • 0.1 – 1% duty cycle • Limited energy reserve 2 “AA” batteries typical • CPU 10 MIPS • RAM 4 KB to 10 KB • ROM 32 KB to 128 KB • Flash 512 KB to 1 MB • Radio 40 kbps to 250 kbps 2000 mA-Hr

  3. Energy-efficient design pervades the research agenda… Energy-efficiency is measured by packets sent, time sleeping, bytes written… …these are all (incompatible) proxy measures.

  4. Energy metering Measure energy usage i(t)  p(t)  ∫p(t)dt Energy breakdown Slice usage horizontally Allocate usage to energy sinks Activity tracking Dice usage vertically Track causal connections Three basic challenges

  5. What’s an activity? Connecting the causal dots… • A causally-connected set of operations… • whose distinct resource consumptions… • should be grouped together for accounting* * M.B. Jones et al., “Modular Real-Time Resource Management in the Rialto Operating System”, HotOS’95, 1995. G. Banga et al. “Resource Containers: A New Facility for Resource Management in Server Systems”, OSDI’99, 1999.

  6. A toy example: where have all the Joules gone? “Slice” by device 48 seconds of Blink “Track” by activity

  7. Outline • Introduction • Why is it hard and how do you solve it? • Energy Metering (“measuring”) • Energy Breakdown (“slicing”) • Activity Tracking (“dicing” and “tracking”) • How well does it work? • How much does it cost? • How could it be used? • What are its limitations?

  8. Measuring: wide horizontal/vertical dynamic range 86,400,000 ms 640,000 ms [Farkas00] TX packet at 1% duty cycle (20 ms / 2 s) 4,000 ms 30 ms

  9. Dynamic range in power draw exceeds 10,000:1 > 50 mW < 1 µW

  10. Quanto uses iCount to solve energy metering challenge Prabal Dutta, Mark Feldmeier, Joseph Paradiso, and David Culler, “Energy Metering for Free: Augmenting Switching Regulators for Real-Time Monitoring”, IPSN’08, St. Louis, MO, 2008. Best Paper Award and ISLPED’08 Design Contest Winner.

  11. Outline • Introduction • Why is it hard and how do you solve it? • Energy Metering (“measuring”) • Energy Breakdown (“slicing”) • Activity Tracking ( “tracking”) • How well does it work? • How much does it cost? • What are its limitations? • How can it be used?

  12. Slicing: breaking down the envelope into its parts Marc A. Viredaz and Deborah A. Wallach, “Power Evaluation of a Handheld Computer”, IEEE Micro, Jan-Feb, 2003

  13. Not all energy sinks can be instrumented Power MCU USART CPU OSC ADC DMA Timer PA LNA Radio Flash Sensors LEDs RX TX Control Power Data

  14. A different approach to energy slicing: power state tracking* • Instrument device drivers • Export device power states • Through narrow interface • OS tracks state transitions On Off * H. Zeng et al. “ECOSystem: Managing Energy as a First Class Operating Systems Resource”, ASPLOS’02, 2002.

  15. Estimate energy breakdowns with regression • For every state transition • Snapshot system-wide power states (α1,…, αn) • Snapshot global energy usage (ΔE) • Snapshot system clock (Δt) • Generate an equation of the form ΔE/Δt = α1p1 +… +, αnpn • (p’s are the unknown power draws) • Solve for p’s using weighted multivariate least squares ΔE α’s pi Δt High-resolution, high-speed energy meter key for good results

  16. Outline • Introduction • Why is it hard and how do you solve it? • Energy Metering (“measuring”) • Energy Breakdown (“slicing”) • Activity Tracking (“tracking”) • Abstractions • Mechanisms • Challenges • How well does it work? • How much does it cost? • What are its limitations? • How can it be used?

  17. Itsy Measured: Breakdown by subsystem Breakdown by application PowerScope Measured: Breakdown by PC Breakdown by PID Tracking: gap between what is measured and what matters Marc A. Viredaz and Deborah A. Wallach, “Power Evaluation of a Handheld Computer”, IEEE Micro, Jan-Feb, 2003 Jason Flinn and M. Satyanarayanan, “Energy-Aware Adaptation for Mobile Apps.”, SOSP’99, Kiawah Island, SC, 1999

  18. What actually matters? Activities* • Energy metering and slicing show • How much energy is used • When energy is used • Where energy is used • But why is the energy being spent? • Activity tracking answers the why question • Attributes usage to meaningful resource principals • Not to: threads, processes, tasks, functions, or PC* * M.B. Jones et al., “Modular Real-Time Resource Management in the Rialto Operating System”, HotOS’95, 1995. G. Banga et al. “Resource Containers: A New Facility for Resource Management in Server Systems”, OSDI’99, 1999. H. Zeng et al. “ECOSystem: Managing Energy as a First Class Operating Systems Resource”, ASPLOS’02, 2002.

  19. Three steps to activity tracking • Annotating • Any abstraction can introduce an annotation • Associates an activity “label” with an execution • Labels are < origin-node : activity-identifier > pairs • Propagating • System software transfers activity labels • Across subsystems, nodes, and deferred computations • Recording • Track, log, and post-process resource usage

  20. Annotating an activity “paints” causally-connected actions • “Sensing” involves • Sensor... • CPU, ADC, I2C bus, … • “Storing” involves • Flash… • CPU, SPI bus, timers, … • Initiate annotation with CPUActivity.set(<label>) • Quanto automatically propagates labels Node A CPU Sensor Flash Act: sensing Act: storing ... CPUActivity.set(ACT_SENSING); Sensor.read(); ... CPUActivity.set(ACT_STORING); Flash.write(...); ...

  21. Outline • Introduction • Why is it hard and how do you solve it? • Energy Metering (“measuring”) • Energy Breakdown (“slicing”) • Activity Tracking (“tracking”) • Abstractions • Mechanisms • Challenges • How well does it work? • How much does it cost? • What are its limitations? • How can it be used?

  22. Deferred computations • Examples • CPU  Post task (deferred function call)  CPU • CPU  Queue object  CPU • Task Scheduler • Add activity field to task structure • Set activity field on task posting • Restore activity on task invocation • Queue • Tag each entry with its activity label • Write activity label on enqueue • Restore activity label on dequeue

  23. Add hidden field to packet Sender’s OS sets activity field Node-to-Node communications CPU Node B Flash Radio CPU Sensor Node A Radio Act: sensing Act: sending Proxy Rx activity Packet Tx Radio.send(message_t* msg) { . . . msg->header->activity = CPUActivity.get(); . . . }

  24. Every interrupt causes energy consumption before activity label is identified Interrupt  CPU Timer  CPU Radio  CPU Proxy activity provides ephemeral label Binding with real activity occurs when label is clear Proxy activities CPU Node B Flash Radio CPU Sensor Node A Radio Act: sensing Act: sending Proxy Rx activity Packet Tx message_t* Radio.recv(message_t* msg, void* payload, uint8_t len) { . . . CPUActivity.bind(msg->hdr->activity); . . . }

  25. Concurrent activities on shared devices (see paper) Timer.start Timer.fired Activity A Timer.start Timer.fired Activity B Timer Power State A A/B B Timer Activities Time Add A Rem B Add B Rem A

  26. Outline • Introduction • Why is it hard and how do you solve it? • How well does it work? • How much does it cost? • How can it be used? • What are its limitations?

  27. Energy breakdown: ground truth & regression results agree 48 seconds of Blink

  28. Outline • Introduction • Why is it hard and how do you solve it? • How well does it work? • How much does it cost? • How can it be used? • What are its limitations?

  29. Software Footprint in TinyOS

  30. Space, Time and Energy Costs • Space • 12 bytes per energy or activity sample • Logging: RAM buffer 800 samples @ 12 bytes each • Time & Energy • Reading time: 19 CPU cycles (19 µs) • Reading energy: 24 CPU cycles (24 µs) • Logging a sample: 102 CPU cycles (102 µs total) • Logging Blink App • 0.12% of CPU time (60.71 ms / 48 s) • 71% of CPU active time! • 0.08% energy (0.41 mJ) • Quanto can measure its own usage

  31. Outline • Introduction • Why is it hard and how do you solve it? • How well does it work? • How much does it cost? • How can it be used? • What are its limitations?

  32. Where have all the Joules gone? “Slice” by device 48 seconds of Blink “Track” by activity

  33. Where have all the (milli)seconds gone? 48 seconds of Blink Activity tracking

  34. What’s the cost of false alarms in Low-Power Listening? D RX Tlisten Preamble D Noise TX

  35. Does it really work over the network? • Bounce: plays ping-pong with a pair of packets • Shows activity on Node 1 that started on Node 4 1 4 Labels are < origin-node : activity-identifier > pairs

  36. Why is TIMERA firing at 16Hz?!?

  37. Outline • Introduction • Why is it hard and how do you solve it? • How well does it work? • How much does it cost? • How can it be used? • What are its limitations?

  38. Limitations • Energy Metering • Requires hardware support • Input voltage dependence  Requires calibration • Hardware tolerances  Requires calibration • Energy Breakdown • Assumes visibility into device power states • Assumes constant per-state power draws • Assumes linearly independent equations • Requires device driver modifications • Activity Tracking • Reentrancy not supported • Requires modifications to OS abstractions

  39. Summary Measure Slice + = CPUActivity.set(ACT_LED0); . . . CPUActivity.set(ACT_LED1); . . . CPUActivity.set(ACT_LED2); Dice Track

  40. What’s Next? • Deploy new platforms • Scale from 2 to 1,000 nodes • Community rollout • In Sourceforge: tinyos-2.x-contrib/berkeley/quanto • Hardware: www.cs.berkeley.edu/~prabal/projects/epic • Documentation: for developers and kernel hackers • Research directions • Explore “energy complexity” of network protocols in the literature • Compare approximation techniques (e.g. counters vs tracing) • Software energy metering • From energy profiling to energy management Benchmark Quanto

  41. Questions? Comments? Discussion?

  42. Backup Slides

  43. Recording: log, export, and post-process data • Challenge is getting data off the node • Reason most applications are still toys Continuous: Parallel Out + Ethernet Burst: 10KB RAM Log + UART Out Burst 128K FIFO Log + UART Out Continuous: Compression + UART Out

  44. Summary of Quanto energy profiling architecture Perform regressions, compute energy breakdowns CPUActivity.set(ACT_SENSING); Allocate usage to activities Application log activity labels log power states, and time and energy usage annotate code with activity labels <PowerStateTrack>, <SingleActivityTrack>, <MultiActivityTrack>, <EnergyMeter> Operating System propagate labels to/from devices propagate labels over deferred computations scheduler interrupts arbiters queues timers <PowerState>, <SingleActivity>, <MultiActivity> Device Drivers save/restore/expose activity monitor/expose power states Hardware Energy Meter

  45. Our solution to this problem • Energy profile by: • Subsystem • Activity • Time call CPUActivity.set(ACT_SENSING); Application <PowerStateTrack>, <SingleActivityTrack>, <MultiActivityTrack>, <EnergyMeter> Operating System <PowerState>, <SingleActivity>, <MultiActivity> Device Drivers Hardware Energy Meter

  46. How much time (or energy) does using DMA save?

  47. module BlinkC () { uses interface Timer<TMilli> as Timer0; uses interface Timer<TMilli> as Timer1; uses interface Timer<TMilli> as Timer2; uses interface Leds; uses interface Boot; } Implementation { event void Boot.booted() { call Timer0.startPeriodic(250); call Timer1.startPeriodic(500); call Timer2.startPeriodic(1000); } event void Timer0.fired() { call Leds.led0Toggle(); } event void Timer1.fired() { call Leds.led1Toggle(); } event void Timer2.fired() { call Leds.led2Toggle(); } } module BlinkC () { uses interface Timer<TMilli> as Timer0; uses interface Timer<TMilli> as Timer1; uses interface Timer<TMilli> as Timer2; uses interface Leds; uses interface Boot; } Implementation { event void Boot.booted() { call CPUActivity.set(ACT_LED0); call Timer0.startPeriodic(250); call CPUActivity.set(ACT_LED1); call Timer1.startPeriodic(500); call CPUActivity.set(ACT_LED2); call Timer2.startPeriodic(1000); } event void Timer0.fired() { call Leds.led0Toggle(); } event void Timer1.fired() { call Leds.led1Toggle(); } event void Timer2.fired() { call Leds.led2Toggle(); } } Blink: A toy example

  48. Is hardware energy metering really needed?

More Related