83
Integrating Concurrency Control Integrating Concurrency Control and Energy Management in Device and Energy Management in Device Drivers Drivers Kevin Klues, Vlado Handziski, Chenyang Lu, Adam Wolisz, David Culler, David Gay, and Philip Levis

Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

1

Integrating Concurrency ControlIntegrating Concurrency Controland Energy Management in Deviceand Energy Management in Device

DriversDrivers

Kevin Klues, Vlado Handziski, Chenyang Lu, Adam Wolisz,David Culler, David Gay, and Philip Levis

Page 2: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

2

Overview

• Concurrency Control: Concurrency of I/O operations alone, not of threads in general

Synchronous vs. Asynchronous I/O

• Energy Management: Power state of devices needed to perform I/O operations

Determined by pending I/O requests using Asynchronous I/O

Page 3: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

3

OSDisk Driver

Overview

Physical Disk

read()

write()

setPowerState()

Application

read()write()read()read()

• Concurrency Control: Concurrency of I/O operations alone, not of threads in general

Synchronous vs. Asynchronous I/O

• Energy Management: Power state of devices needed to perform I/O operations

Determined by pending I/O requests using Asynchronous I/O

Page 4: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

4

Overview

The more workload information an application can give the OS, the more energy it

can save when scheduling that workload

• Concurrency Control: Concurrency of I/O operations alone, not of threads in general

Synchronous vs. Asynchronous I/O

• Energy Management: Power state of devices needed to perform I/O operations

Determined by pending I/O requests using Asynchronous I/O

Page 5: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

5

Outline

• Background Information• Platform and Application• Driver architecture• Evaluation• Conclusion

Page 6: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

6

Motivation

• Difficult to manage energy in traditional OSs Hard to tell OS about future application workloads

All logic pushed out to the application

API extensions for hints?

Page 7: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

7

Existing OS Approaches

• Dynamic CPU Voltage ScalingVertigo - Application workload classes

Grace OS - Explicit realtime deadlines

• Disk Spin DownCoop-IO - Application specified timeouts

Page 8: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

8

Existing OS Approaches

Saving energy is a complex process

• Dynamic CPU Voltage ScalingVertigo - Application workload classes

Grace OS - Explicit realtime deadlines

• Disk Spin DownCoop-IO - Application specified timeouts

Page 9: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

9

Existing OS Approaches

Saving energy is a complex processA little application knowledge can help us alot

• Dynamic CPU Voltage ScalingVertigo - Application workload classes

Grace OS - Explicit realtime deadlines

• Disk Spin DownCoop-IO - Application specified timeouts

Page 10: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

10

Sensor Networks

• Domain in need of unique solution to this problem Harsh energy requirements Very small source of power (2AA batteries)‏ Must run unattended from months to years

Page 11: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

11

Sensor Networks

• Domain in need of unique solution to this problem Harsh energy requirements Very small source of power (2AA batteries)‏ Must run unattended from months to years

• First generation sensornet OSes (TinyOS, Contiki, Mantis, ...)‏ Push all energy management to the application Optimal energy savings at cost of application complexity

Page 12: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

12

ICEM: Integrated Concurrencyand Energy Management

• A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

Introduces Power Locks, split-phase locks with integrated energyand configuration management

Defines three classes of drivers: dedicated, shared, virtualized

Provides a component library for building drivers

Page 13: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

13

ICEM: Integrated Concurrencyand Energy Management

• A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

Introduces Power Locks, split-phase locks with integrated energyand configuration management

Defines three classes of drivers: dedicated, shared, virtualized

Provides a component library for building drivers

• Advantages of using ICEM Energy efficient – At least 98.4% as hand-tuned implementation

Reduces code complexity – 400 vs. 68 lines of code

Enables natural decomposition of applications

Page 14: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

14

Outline

• Introduction and Motivation• Platform and Application• ICEM architecture• Evaluation• Conclusion

Page 15: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

15

The Tmote Platform

• Six major I/O devices

• Possible Concurrency

I2C, SPI, ADC

• Energy Management

Turn peripherals on only when needed

Turn off otherwise

Page 16: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

16

Representative LoggingApplication

Every 12 hours: For all new entries: Send current sample Read next sample

Flash

Consumer

Sensors Radio

Every 5 minutes: Write prior samples Sample photo active Sample total solar Sample temperature Sample humidity

Producer

Page 17: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

17

Representative LoggingApplication

Every 12 hours: For all new entries: Send current sample Read next sample

Flash

Consumer

Sensors Radio

Every 5 minutes: Write prior samples Sample photo active Sample total solar Sample temperature Sample humidity

Producer

Page 18: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

18

Representative LoggingApplication

Every 12 hours: For all new entries: Send current sample Read next sample

Flash

Consumer

Sensors Radio

Every 5 minutes: Write prior samples Sample photo active Sample total solar Sample temperature Sample humidity

Producer

Page 19: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

19

Representative LoggingApplication

Every 12 hours: For all new entries: Send current sample Read next sample

Flash

Consumer

Sensors Radio

Every 5 minutes: Write prior samples Sample photo active Sample total solar Sample temperature Sample humidity

Producer

Page 20: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

20

Representative LoggingApplication

Every 12 hours: For all new entries: Send current sample Read next sample

Flash

Consumer

Sensors Radio

Every 5 minutes: Write prior samples Sample photo active Sample total solar Sample temperature Sample humidity

Producer

Page 21: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

21

Representative LoggingApplication

Every 12 hours: For all new entries: Send current sample Read next sample

Flash

Consumer

Sensors Radio

Every 5 minutes: Write prior samples Sample photo active Sample total solar Sample temperature Sample humidity

Producer

Page 22: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

22

Representative LoggingApplication

Every 12 hours: For all new entries: Send current sample Read next sample

Flash

Consumer

Sensors Radio

Every 5 minutes: Write prior samples Sample photo active Sample total solar Sample temperature Sample humidity

Producer

Page 23: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

23

Representative LoggingApplication

Every 12 hours: For all new entries: Send current sample Read next sample

Flash

Consumer

Sensors Radio

Every 5 minutes: Write prior samples Sample photo active Sample total solar Sample temperature Sample humidity

Producer

Page 24: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

24

Representative LoggingApplication

Every 12 hours: For all new entries: Send current sample Read next sample

Flash

Consumer

Sensors Radio

Every 5 minutes: Write prior samples Sample photo active Sample total solar Sample temperature Sample humidity

Producer

Page 25: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

25

Code Complexity

Hand-Tuned Application

Page 26: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

26

Code Complexity

Every 5 minutes: Turn on SPI bus Turn on flash chip Turn on voltage reference Turn on I2C bus Log prior readings Start humidity sample Wait 5ms for log Turn off flash chip Turn off SPI bus Wait 12ms for vref Turn on ADC Start total solar sample Wait 2ms for total solar Start photo active sample Wait 2ms for photo active Turn off ADC Turn off voltage reference Wait 34ms for humidity Start temperature sample Wait 220ms for temperature Turn off I2C bus

Hand-Tuned Application

Page 27: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

27

Code Complexity

Every 5 minutes: Turn on SPI bus Turn on flash chip Turn on voltage reference Turn on I2C bus Log prior readings Start humidity sample Wait 5ms for log Turn off flash chip Turn off SPI bus Wait 12ms for vref Turn on ADC Start total solar sample Wait 2ms for total solar Start photo active sample Wait 2ms for photo active Turn off ADC Turn off voltage reference Wait 34ms for humidity Start temperature sample Wait 220ms for temperature Turn off I2C bus

Hand-Tuned Application

Page 28: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

28

Code Complexity

Every 5 minutes: Turn on SPI bus Turn on flash chip Turn on voltage reference Turn on I2C bus Log prior readings Start humidity sample Wait 5ms for log Turn off flash chip Turn off SPI bus Wait 12ms for vref Turn on ADC Start total solar sample Wait 2ms for total solar Start photo active sample Wait 2ms for photo active Turn off ADC Turn off voltage reference Wait 34ms for humidity Start temperature sample Wait 220ms for temperature Turn off I2C bus

Hand-Tuned Application

Page 29: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

29

Code Complexity

Every 5 minutes: Log prior readings sample humidity sample total solar sample photo active sample temperature

ICEM ApplicationEvery 5 minutes: Turn on SPI bus Turn on flash chip Turn on voltage reference Turn on I2C bus Log prior readings Start humidity sample Wait 5ms for log Turn off flash chip Turn off SPI bus Wait 12ms for vref Turn on ADC Start total solar sample Wait 2ms for total solar Start photo active sample Wait 2ms for photo active Turn off ADC Turn off voltage reference Wait 34ms for humidity Start temperature sample Wait 220ms for temperature Turn off I2C bus

Hand-Tuned Application

Page 30: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

30

Outline

• Introduction and Motivation• Platform and Application• ICEM architecture• Evaluation• Conclusion

Page 31: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

31

Split-Phase I/O Operations

• Split-phase I/O operations Implemented within a single thread of control

Application notified of I/O completion through direct upcall

Driver given workload information before returning control

Example: read() readDone() ‏

Application

Driver

read()‏ readDone() ‏

I/O request I/O interrupt

void readDone(uint16_t val) { next_val = val; read();}

Page 32: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

32

ICEM Architecture

• Defines three classes of drivers

Virtualized – provide only functional interface

Dedicated – provide functional and power interface

Shared – provide functional and lock interface

Page 33: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

33

Virtualized Device Drivers

• Provide only a Functional interface

• Assume multiple users

• Implicit concurrency control through buffering requests

• Implicit energy management based on pending requests

• Implemented for higher-level services that can toleratelonger latencies

Energy: ImplicitConcurrency: Implicit

Virtualized

Page 34: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

34

Dedicated Device Drivers

• Provide Functional and Power Control interfaces

• Assume a single user

• No concurrency control

• Explicit energy management

• Low-level hardware and bottom-level abstractions have adedicated driver

Energy: ImplicitConcurrency: None

Dedicated

Page 35: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

35

Shared Device Drivers

• Provide Functional and Lock interfaces

• Assume multiple users

• Explicit concurrency control through Lock request

• Implicit energy management based on pending requests

• Used by users with stringent timing requirements

Energy: ImplicitConcurrency: Explicit

Shared

Page 36: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

36

ICEM Architecture

• Defines three classes of drivers

Virtualized – provide only functional interface

Dedicated – provide functional and power interface

Shared – provide functional and lock interface

• Power Locks, split-phase locks with integrated energy andconfiguration management

Page 37: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

37

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

Page 38: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

38

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

Page 39: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

39

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

Page 40: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

40

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

Page 41: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

41

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

Page 42: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

42

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

Page 43: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

43

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

Page 44: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

44

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

Page 45: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

45

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

Page 46: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

46

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

123

Page 47: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

47

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

Lock---

Page 48: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

48

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

---

Page 49: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

49

Power Locks

DedicatedDriver

Power Locks

PowerControl

HW-SpecificConfiguration

Lock

Functional

---

Page 50: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

50

ICEM Architecture

• Defines three classes of drivers

Virtualized – provide only functional interface

Dedicated – provide functional and power interface

Shared – provide functional and lock interface

• Power Locks, split-phase locks with integrated energy andconfiguration management

• Component library

Arbiters – manage I/O concurrency

Configurators – setup device specific configurations

Power Managers – provide automatic power management

Page 51: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

51

Component Library

Lock

Power Locks

PowerControl

HW-SpecificConfiguration

Page 52: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

52

Component Library

Lock

PowerControl

HW-SpecificConfiguration

Arbiter

ArbiterConfigure

DefaultOwner

Configurator Power Manager

Page 53: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

53

Component Library

PowerControl

HW-SpecificConfiguration

Arbiter

ArbiterConfigure

DefaultOwner

Configurator Power Manager

Lock

Lock interface for concurrency control (FCFS, Round-Robin)‏ ArbiterConfigure interface automatic hardware configuration

DefaultOwner interface for automatic power management

Page 54: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

54

Component Library

PowerControl

HW-SpecificConfiguration

Arbiter

ArbiterConfigure

DefaultOwner

Configurator Power Manager

Lock

Lock interface for concurrency control (FCFS, Round-Robin)‏ ArbiterConfigure interface automatic hardware configuration

DefaultOwner interface for automatic power management

---

Page 55: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

55

Component Library

PowerControl

HW-SpecificConfiguration

Arbiter

ArbiterConfigure

DefaultOwner

Configurator Power Manager

Lock

Implement ArbiterConfigure interface

Call hardware specific configuration from dedicated driver

Page 56: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

56

Component Library

PowerControl

HW-SpecificConfiguration

Arbiter

ArbiterConfigure

DefaultOwner

Configurator Power Manager

Lock

Implement DefaultOwner interface

Power down device when device falls idle

Power up device when new lock request comes in

Currently provide Immediate and Deferred policies

Page 57: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

57

Shared Driver Example

• Msp430 USART (Serial Controller)Three modes of operation – SPI, I2C, UART

Page 58: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

58

Shared Driver Example

Msp430 USART

• Msp430 USART (Serial Controller)Three modes of operation – SPI, I2C, UART

Power Control

Functional Configuration

Page 59: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

59

Shared Driver Example

Arbiter

ImmediatePower Manager

SPI User

Msp430 USART

• Msp430 USART (Serial Controller)Three modes of operation – SPI, I2C, UART

SPIConfigurator

Power Control

Functional Configuration

Lock

Page 60: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

60

UartConfigurator

Shared Driver Example

• Msp430 USART (Serial Controller)Three modes of operation – SPI, I2C, UART

Arbiter

ImmediatePower Manager

SPI User

Msp430 USART

SPIConfigurator

Uart User

I2C UserI2C

Configurator

Power Control

Functional Configuration

Lock

Page 61: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

61

Virtualized Driver Example

• Flash Storage

Arbiter

ImmediatePower ManagerSPI User

Log User

Flash Driver

Log Virtualizer

Lock

Power Control

Functional

Page 62: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

62

Virtualized Driver Example

• Flash Storage

Arbiter

ImmediatePower ManagerSPI User

Log User

Flash Driver

Log Virtualizer

Lock

Power Control

Functional

Page 63: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

63

Virtualized Driver Example

• Flash Storage

Arbiter

ImmediatePower ManagerSPI User

Log User

Flash Driver

Log Virtualizer

Lock

Power Control

Functional

Page 64: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

64

Virtualized Driver Example

• Flash Storage

Arbiter

ImmediatePower ManagerSPI User

Log User

Flash Driver

Log Virtualizer

Lock

Power Control

Functional

Page 65: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

65

Virtualized Driver Example

• Flash Storage

Arbiter

ImmediatePower ManagerSPI User

Log User

Flash Driver

Log Virtualizer

Lock

Power Control

Functional

---

Page 66: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

66

Virtualized Driver Example

• Flash Storage

Arbiter

ImmediatePower ManagerSPI User

Log User

Flash Driver

Log Virtualizer

Lock

Power Control

Functional

Page 67: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

67

Virtualized Driver Example

• Flash Storage

Arbiter

ImmediatePower ManagerSPI User

Log User

Flash Driver

Log Virtualizer

Lock

Power Control

Block Virtualizer

Block User

Page 68: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

68

Virtualized Driver Example

• Flash Storage

Arbiter

ImmediatePower ManagerSPI User

Flash Driver Lock

Power Control

Log User

Log VirtualizerBlock Virtualizer

Block User

Page 69: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

69

Outline

• Introduction and Motivation• Platform and Application• ICEM architecture• Evaluation• Conclusion

Page 70: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

70

Applications

• Hand Tuned – Most energy efficient• ICEM – All concurrent operations• Serial + – Optimal serial ordering• Serial - – Worst case serial ordering

Every 12 hours: For all new entries: Send current sample Read next sample

Flash

Consumer

Sensors Radio

Every 5 minutes: Write prior samples Sample photo active Sample total solar Sample temperature Sample humidity

Producer

Page 71: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

71

Tmote Energy Consumption

Average energy consumption for application operations

Page 72: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

72

Tmote Energy Consumption

Average energy consumption for application operations

Page 73: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

73

Application EnergyConsumption

Application energy with 5 minute sampling interval and one send batch every 12 hours

Page 74: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

74

Application EnergyConsumption

Application energy with 5 minute sampling interval and one send batch every 12 hours

Page 75: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

75

Application EnergyConsumption

Application energy with 5 minute sampling interval and one send batch every 12 hours

Page 76: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

76

Sampling Power Trace

Overhead of ICEM to Hand-Tuned Implementation= ADC Timeout + Power Lock Overheads

With 288 samples per day≈ 2.9 mAs/day ≈ 1049 mAs/year

Insignificant compared to total5.60% of total sampling energy0.03% of total application energy

Page 77: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

77

Expected Node Lifetimes

Page 78: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

78

Expected Node Lifetimes

Page 79: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

79

Expected Node Lifetimes

Page 80: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

80

Evaluation Conclusions

• Conclusions about the OS Small RAM/ROM overhead Small computational overhead Efficiently manages energy when given enough

information• Conclusions for the developer

Build drivers short power down timeouts Submit I/O requests in parallel

Page 81: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

81

Conclusion

• ICEM: Integrated Concurrency and Energy Management Device driver architecture for low power devices

At least 98.4% as energy efficient as hand-tunedimplementation of representative application

Simplifies application and driver development

Questions the assumption that applications must be responsiblefor all energy management and cannot have a standardized OSwith a simple API

Page 82: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

82

Questions?

Page 83: Integrating Concurrency Control and Energy Management in ... · •A device driver architecture that automatically manages energy Implemented in TinyOS 2.0 -- all drivers follow it

83

Questions?

• SourceForge TinyOS CVS repository: http://sourceforge.net/cvs/?group_id=28656

• Library components and interfaces tinyos-2.x/tos/interfaces tinyos-2.x/tos/lib/power tinyos-2.x/tos/system

• Example Drivers Atmega128 ADC: tos/chips/atm128/adc MTS300 Photo: tos/sensorboards/mts300 MSP430 USART0: tos/chips/msp430/usart Storage: tos/chips/stm25p CC2420: tos/chips/cc2420