Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Tracking Energy in Networked Embedded Systems Rodrigo Fonseca † *, Prabal Dutta †, Philip Levis ‡, Ion Stoica † Computer Science Division † University.

Similar presentations


Presentation on theme: "1 Tracking Energy in Networked Embedded Systems Rodrigo Fonseca † *, Prabal Dutta †, Philip Levis ‡, Ion Stoica † Computer Science Division † University."— Presentation transcript:

1 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 Computer Science Department ‡ Stanford University pal@cs.stanford.edu OSDI’08 – San Diego, California – Dec. 8-10, 2008 Yahoo! Research * Santa Clara, CA rfonseca@yahoo-inc.com

2 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 reserve2 “AA” batteries typical CPU10 MIPS RAM4 KB to 10 KB ROM32 KB to 128 KB Flash512 KB to 1 MB Radio40 kbps to 250 kbps 2000 mA-Hr

3 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 4 Three basic challenges 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

5 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 6 A toy example: where have all the Joules gone? 48 seconds of Blink “Slice” by device “Track” by activity

7 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 8 Measuring: wide horizontal/vertical dynamic range TX packet at 1% duty cycle (20 ms / 2 s) 4,000 ms 640,000 ms 86,400,000 ms [Farkas00] 30 ms

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

10 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 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 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 13 Not all energy sinks can be instrumented MCU Radio Power FlashSensorsLEDs PowerData Control USART DMA OSC Timer ADC RXTX LNAPA CPU

14 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 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 = α 1 p 1 +… +, α n p n (p’s are the unknown power draws) Solve for p’s using weighted multivariate least squares High-resolution, high-speed energy meter key for good results ΔtΔt ΔEΔE α’s pipi

16 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 17 Tracking: gap between what is measured and what matters Itsy Measured: –Breakdown by subsystem –Breakdown by application PowerScope Measured: –Breakdown by PC –Breakdown by PID 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 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 19 Three steps to activity tracking Annotating –Any abstraction can introduce an annotation –Associates an activity “label” with an execution –Labels are pairs Propagating –System software transfers activity labels –Across subsystems, nodes, and deferred computations Recording –Track, log, and post-process resource usage

20 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( ) Quanto automatically propagates labels... CPUActivity.set(ACT_SENSING); Sensor.read();... CPUActivity.set(ACT_STORING); Flash.write(...);... CPU Sensor Flash Node A Act: sensing Act: storing

21 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 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 23 Node-to-Node communications CPU Flash Radio Node B CPU Sensor Radio Node A Act: sensingAct: sending Proxy Rx activityPacket Tx Add hidden field to packet Sender’s OS sets activity field Radio.send(message_t* msg) {... msg->header->activity = CPUActivity.get();... }

24 24 Proxy activities CPU Flash Radio Node B CPU Sensor Radio Node A Act: sensingAct: sending Proxy Rx activityPacket Tx 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 message_t* Radio.recv(message_t* msg, void* payload, uint8_t len) {... CPUActivity.bind(msg->hdr->activity);... }

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

26 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 27 Energy breakdown: ground truth & regression results agree 48 seconds of Blink LED0LED1LED2CPUBaseline O’scope2.50 mA2.23 mA0.83 mA- n/a -0.79 mA Quanto2.51 mA2.24 mA0.83 mA1.43 mA0.83 mA

28 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 29 Software Footprint in TinyOS

30 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 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 32 Where have all the Joules gone? “Slice” by device “Track” by activity 48 seconds of Blink

33 33 Where have all the (milli)seconds gone? 48 seconds of BlinkActivity tracking

34 34 What’s the cost of false alarms in Low-Power Listening? PreambleD TX RX D T listen Noise

35 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 Labels are pairs 1 4

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

37 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 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 39 Summary += CPUActivity.set(ACT_LED0);... CPUActivity.set(ACT_LED1);... CPUActivity.set(ACT_LED2); Measure Slice Dice Track

40 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 BenchmarkQuanto

41 41 Questions? Comments? Discussion?

42 42 Backup Slides

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

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

45 45 Our solution to this problem Device Drivers Hardware Application Operating System,,,,, Energy Meter Energy profile by: 1)Subsystem 2)Activity 3)Time call CPUActivity.set(ACT_SENSING);

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

47 47 Blink: A toy example module BlinkC () { uses interface Timer as Timer0; uses interface Timer as Timer1; uses interface Timer 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 as Timer0; uses interface Timer as Timer1; uses interface Timer 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(); } }

48 48 Is hardware energy metering really needed?


Download ppt "1 Tracking Energy in Networked Embedded Systems Rodrigo Fonseca † *, Prabal Dutta †, Philip Levis ‡, Ion Stoica † Computer Science Division † University."

Similar presentations


Ads by Google