Integrating concurrency control and energy management in device drivers Presented By Ahmed Elnably and Andrew Sedlmayr ELEC 518 Rice University.

Slides:



Advertisements
Similar presentations
Phil Buonadonna, Jason Hill CS-268, Spring 2000 MOTE Active Messages Communication Architectures for Networked Mini-Devices Networked sub-devicesActive.
Advertisements

3.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Process An operating system executes a variety of programs: Batch system.
Operating System Structures
QNX® real-time operating system
Sensor Network Platforms and Tools
Overview: Chapter 7  Sensor node platforms must contend with many issues  Energy consumption  Sensing environment  Networking  Real-time constraints.
Medium Access Control in Wireless Sensor Networks.
Introduction CSCI 444/544 Operating Systems Fall 2008.
Chapter 13 Embedded Systems
Chapter 13 Embedded Systems Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
How to Code on TinyOS Xufei Mao Advisor: Dr. Xiang-yang Li CS Dept. IIT.
Mica: A Wireless Platform for Deeply Embedded Networks Jason Hill and David Culler Presented by Arsalan Tavakoli.
Integrated  -Wireless Communication Platform Jason Hill.
Generic Sensor Platform for Networked Sensors Haywood Ho.
Chapter 13 Embedded Systems
Versatile low power media access for wireless sensor networks Joseph PolastreJason HillDavid Culler Computer Science Department University of California,Berkeley.
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating Systems.
Chapter 13 Embedded Operating Systems Eighth Edition By William Stallings Operating Systems: Internals and Design Principles.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
CS 423 – Operating Systems Design Lecture 22 – Power Management Klara Nahrstedt and Raoul Rivas Spring 2013 CS Spring 2013.
Spring 2000, 4/27/00 Power evaluation of SmartDust remote sensors CS 252 Project Presentation Robert Szewczyk Andras Ferencz.
A System Architecture for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister
Energy Management in TinyOS 2. Learning Objectives Understand the basic ideas of Integrated Concurrency and Energy Management (ICEM) Understand representative.
Introduction and Overview Questions answered in this lecture: What is an operating system? How have operating systems evolved? Why study operating systems?
Low-Power Wireless Sensor Networks
1 COMPSCI 110 Operating Systems Who - Introductions How - Policies and Administrative Details Why - Objectives and Expectations What - Our Topic: Operating.
1 XYZ: A Motion-Enabled, Power Aware Sensor Node Platform for Distributed Sensor Network Applications Presenter: James D. Lymberopoulos, A. Savvides.
Dhanshree Nimje Smita Khartad
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presented by Yang Zhao.
Power and Control in Networked Sensors E. Jason Riedy and Robert Szewczyk Presenter: Fayun Luo.
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presenter: James.
Intel Research & Development ETA: Experience with an IA processor as a Packet Processing Engine HP Labs Computer Systems Colloquium August 2003 Greg Regnier.
Xiong Junjie Node-level debugging based on finite state machine in wireless sensor networks.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Full and Para Virtualization
Link Layer Support for Unified Radio Power Management in Wireless Sensor Networks IPSN 2007 Kevin Klues, Guoliang Xing and Chenyang Lu Database Lab.
0.1 IT 601: Mobile Computing Wireless Sensor Network Prof. Anirudha Sahoo IIT Bombay.
System Architecture Directions for Networked Sensors.
CSE466 - Fall What is an Embedded System  Its not a desktop system  Fixed or semi-fixed functionality (not user programmable)  Lacks some or.
Energy Management in T2. [Energy_1]2 Motivation If the application must explicitly invoke power control operations, this will introduce application code.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
OPERATING SYSTEM REVIEW. System Software The programs that control and maintain the operation of the computer and its devices The two parts of system.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Why does it need? [USN] ( 주 ) 한백전자 Background Wireless Sensor Network (WSN)  Relationship between Sensor and WSN Individual sensors are very limited.
Software Architecture of Sensors. Hardware - Sensor Nodes Sensing: sensor --a transducer that converts a physical, chemical, or biological parameter into.
Matthew Locke November 2007 A Linux Power Management Architecture.
- Pritam Kumat - TE(2) 1.  Introduction  Architecture  Routing Techniques  Node Components  Hardware Specification  Application 2.
Introduction to Operating Systems Concepts
INTRODUCTION TO WIRELESS SENSOR NETWORKS
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
Introduction to threads
Overview Motivation (Kevin) Thermal issues (Kevin)
COMPSCI 110 Operating Systems
REAL-TIME OPERATING SYSTEMS
Topics Covered What is Real Time Operating System (RTOS)
Processes and Threads Processes and their scheduling
Task Scheduling for Multicore CPUs and NUMA Systems
Ultra-Low-Power Sensor Nodes Featuring a Virtual Runtime Environment
KERNEL ARCHITECTURE.
Chapter 4: Threads.
Operating System Review
Embedded Operating Systems
CHAPTER 4:THreads Bashair Al-harthi OPERATING SYSTEM
Chapter 4: Threads & Concurrency
Outline Operating System Organization Operating System Examples
CSE 542: Operating Systems
Lecture Topics: 11/1 Hand back midterms
Presentation transcript:

Integrating concurrency control and energy management in device drivers Presented By Ahmed Elnably and Andrew Sedlmayr ELEC 518 Rice University

Sensor Networks Where can we find them? Simple answer: Everywhere!! Industrial applications: Petroleum Radiation detection (Japan) Global warming Weather forecasting (Sometimes they get it right!!!)

Challenges Ease of use Withstand Harsh environmental conditions Mobile Light weight Low power Small battery Energy Harvesting Communication failures Dynamic network topology Must run unattended from days to years

Kevin Klues U of Washington for masters UC Berkeley for PhD

Chenyang Lu Kevins masters adviser Research topics includes sensor networks and real time systems Has 4 papers cited more than 50 times, 3 about sensor networks

Vlado Handziski Researcher at Technische Universität Berlin in the Telecommunication Networks Group (TKN) Research interests Wireless sensor networks

Adam Wolisz Prof in Technische Universität Berlin, he founded the TKN One of his research interests are sensor networks

David Culler Chair of CS department at UC Berekely One of the inventors of TinyOS, the most famous sensor networks OS citation papers! Most of them in sensor networks

David Gay Was a programming language research in Intel research labs, currently in Google Helped invent TinyOs

Philip Levis Assistant professor at Stanford His top 8 cited papers (40+ citations) are about sensor networks Research interest includes sensor networks

Motivation Traditional Embedded Operating Systems VxWorks – Multicore, preemptive, blocking QNX – Multicore, Microkernel architecture, POSIX eCos – One process, preemptive, multiple threads TinyOS – Single Thread/Stack, non-blocking Difficult to manage energy in traditional Operating Systems Hard to tell the OS about future application workloads All energy management logic pushed out to the application Optimal energy savings at cost of application complexity

Existing OS Approaches Dynamic CPU Voltage Scaling Vertigo – Application workload classes Grace OS – Explicit realtime deadlines Disk Spin Down Coop-IO – Application specified timeouts Energy Allocation Cinder Operating System – Reserves and Taps ECOSystem – Currentcy ACPI OS directed configuration, power and thermal management of computing platforms

Device Drivers Power Management Mac OS X Linux 2.6 Windows ACPI Platform Independent Specification Hardware Support Function Fixed Hardware Interface relies on AML ACPI Component Architecture Global States: G0-G3, (G0)S0, (G1)S1-S4, (G2)S5 Processor States: C0-C3 Device States: D0-D3 Performance States: P0-Pn (C0, D0) Device power management

Case Study Mac OS X Device Drivers live in the kernel space (KEXTs) Directly access hardware devices Use primary interrupts I/O Kit Device interface - user space library through which the application communicates with a device. User client – in-kernel object that provides a connection between the device driver and application in user space POSIX Device Drivers live in the kernel space (KEXTs) Directly access hardware devices Use primary interrupts

Case Study Mac OS X Power Events Sleep – All drivers must respond Wake – All drivers must respond Shutdown – Drivers do not need to respond The Power Plane: A Hierarchy of Power Dependencies Devices and Power States Off and On required Power State Attributes The capability of the device while in a given state The devices power requirements of its power parent The power characteristics the device can provide to its power children The version of the power-state structure the device uses to store its power-state information Two Types of Drivers Passive – Responds to system power events Active – Performs tasks such as deciding when the device should become idle and changing the devices power state

Embedded OS QNX Why not use APM or its successor ACPI? Application-driven framework Power manager – Process that implements the system power management policy Power-managed objects – Hardware components that can be independently power managed Power-aware application – User applications that interact with the power manager Persistent storage service – Preserves hardware and software configuration details during low power modes BSP support – Board specific initial program loader

More Challenges Device Control Future application workload When do you power down a device? Traditional I/O Handling Control returns to application after I/O is complete Application Kernel Device

Overview Concurrency Control Concurrency of I/O operations alone, not of threads in general Synchronous vs. Asynchronous I/O Asynchronous I/O can improve energy efficiency by allowing the OS to schedule it Energy Management Power state of device needed to perform I/O operations Determined by pending I/O requests using Asynchronous I/O

Integrated Concurrency and Energy Management (ICEM) Device driver architecture that manages energy Implemented in TinyOS 2.0 Three driver classes: virtualized, shared, dedicated Power Locks: synchronization primitives which couple energy, configuration, and concurrency management. Component library: arbiters, power managers, and configurators. Advantages of ICEM Energy Efficient: within 1.6% of hand tuned implementation Reduces code complexity: 400 vs 68 lines (nesC)

Hardware Platform CPU MSP430 8Mhz, 16-bit I 2 C, SPI, ADC 10kB Ram Radio CC kbps, Flash ST M25P80 2Mb External Total Solar TSR Photodiode Photo Active PAR Photodiode Temperature and Humidity SHT11

Hardware Platform Six Major I/O Devices Possible Concurrency I 2 C, SPI, ADC Energy Management Power on peripherals only when needed

Example Application Requirements Every 5 Minutes Sample all the sensors and log the readings to flash Every 12 Hours Retrieve new readings from flash and send to central collection unit Pseudocode

Example Application – Work Flow

Example Application Energy efficient application Pseudocode

Example Application Energy efficient application Pseudocode Device Power Control

Example Application Energy efficient application Pseudocode Device Wait Times

Example Application ICEM Application – Look familiar? Removed device control from application

ICEM Attributes Three classes of drivers Virtualized – Functional Interface Dedicated – Functional and Power Interfaces Shared – Functional and Lock Interfaces

Virtualized Device Driver Provides a Functional interface Assumes multiple users Implemented for higher-level users that can tolerate longer latencies Concurrency Control Implicit control through buffering requests Energy Management Implicit management based on pending requests

Dedicated Device Driver Provides a Functional and Power Control interface Assumes one user Implemented for lowest-level hardware independent abstractions Concurrency Control None Energy Management Explicit management through power control interface

Shared Device Driver Provides Functional and Lock interfaces Assumes multiple users Implemented for lower-level users that require stringent timing requirements Concurrency Control Explicit control through Lock requests Energy Management Implicit management base on pending requests

ICEM Attributes Three classes of drivers Virtualized – Functional Interface Dedicated – Functional and Power Interfaces Shared – Functional and Lock Interfaces Power Locks – Split phase locks with integrated energy and configuration management

Power Locks Used to synchronize access to drivers between software components Idle Lock Turn off device Client could specify device configuration Client request a lock, provide a callback function when it is given the lock Deadlock problems could arise

Power Locks

ICEM Attributes Three classes of drivers Virtualized – Functional Interface Dedicated – Functional and Power Interfaces Shared – Functional and Lock Interfaces Power Locks – Split phase locks with integrated energy and configuration management Component Library Arbiters – manages I/O concurrency Configurators – provides device specific configurations Power Managers – provides energy management policy

Component Library Used to implement Power lock

Component Library Lock interface for concurrency control (FCFS, Round-Robin ArbiterConfigure interface for automatic hardware configuration DefaultOwner interface for automatic power management

Component Library Implement ArbiterConfigure Interface Call hardware specific configuration from dedicated driver

Component Library Implement DefaultOwner interface Power down device when device falls idle Power up device when lock request is received Provides Immediate and Deferred policies

Shared Example Driver MSP430 USART0 Three modes of operation - SPI, I 2 C, UART

Shared Example Driver MSP430 USART0 Three modes of operation - SPI, I 2 C, UART

Shared Example Driver MSP430 USART0 Three modes of operation - SPI, I 2 C, UART

Shared Example Driver MSP430 USART0 Three modes of operation - SPI, I 2 C, UART POWER LOCK

Drawbacks ICEM Overhead RAM and ROM – Library components require additional code space and memory. CPU cycles – calls utilizing shared drivers must go through arbiters, power managers.

Arbiter Overhead Arbiter Overhead (RAM) 350 – 550 bytes Initial overhead Increases linearly with the number of clients

Arbiter Overhead Arbiter Overhead (CPU)

Arbiter Overhead Arbiter Overhead (CPU)

Arbiter Overhead Arbiter Overhead (CPU)

Power Manager Overhead Power manager library components RAM and ROM overhead Cycle count overhead

Drawbacks ICEM Overhead RAM and ROM – Library components require additional code space and memory. CPU cycles – calls utilizing shared drivers must go through arbiters. What does this overhead mean to power consumption?

Energy Overhead Hand Tuned – Most energy efficient ICEM – All concurrent operations Serial+– Optimal serial ordering Serial-– Worst Case serial ordering

Energy Overhead Application Energy per Day 5 Minute sampling interval 12 hour send cycle

Energy Overhead Average energy consumption

Energy Overhead Overhead of ICEM vs Energy Efficient implementation ADC Timeout + Power Lock Overhead Overhead (Assume 288 samples per day) 2.9mAs/day ~= 1029 mAs/year 5.60% of total sampling energy 0.03% of total application energy

Hand-Tuned Node Lifetime Assume 2 AA batteries ~= 2700mAh 2.93 Years with 5 minute sample interval

Node Lifetime Comparison

Conclusions ICEM: Integrated Concurrency and Energy Management Device driver architecture for ultra-low power device Applications operate within 1.6% of hand-tuned optimal energy implementation (based on representative application) Simplifies application and driver development Based on the hypothesis that the most useful power management information an application can provide an OS is the potential concurrency of its I/O operations. Application level concurrency allows the OS to save energy by efficiently scheduling I/O operations Questions the assumption that sensornet applications must be responsible for all energy management and cannot use a standardized OS with a simple API.

Paper Analysis What is new (2007) OS power management support in a RTOS Implemented in TinyOS – Split Phase Using a traditionally passive mechanism to implement an active power policy Idea that concurrency is the most important power information you can pass to the OS What isnt so new The idea of abstracting power management controls from the application to the OS (OSPM)

Paper Quality Pros Major Conference (SOSP 07) Credible Authors Application using ICEM is within 1.6% energy consumption of the ideal implementation Low overhead (Memory and Computational) Reduces application complexity Unique Solution

Paper Quality Cons Small number of citations (11 in 3.5 years) Increases initial development time All conclusions based on a representative simple application and hardware platform Low Duty Cycle All sensors sampled at same frequency Solution based on assumption that the most important information an application can provide the OS is the potential concurrency of its I/O operations. Potential for Deadlock Scalability

Questions?

System Power

Virtualized Example Driver Flash Storage

Example CC2420 Stack 3 Shared Drivers SPI 2 Dedicated Drivers GPIO Timer 2 Virtualized Drivers Send Receive

Other Papers V. Venkatachalam and M. Franz. Power Reduction Techniques For Microprocessor Systems ACM Computing Surveys, 37(3): , 2005 Dutta, P., Culler, D., and Shenker, S.Procrastination might lead to a longer and more useful life. HotNets- VI (2007).

Device Driver Links QNX Developer Support " _arch/power.html Linux Device Drivers Mac Os X Developers Library iceDrivers/Conceptual/IOKitFundamentals/PowerMgmt/Pow erMgmt.html The Windows 2000 device driver book 87&lpg=PA187&dq=device+drivers+that+manage+power&so urce=bl&ots=dwTefjhD67&sig=WjjWzBABUZC53vbtjnYq4 OZGso4&hl=en&ei=ONOcTe7FBYKftwe0ofnVBw&sa=X&oi =book_result&ct=result&resnum=6&ved=0CEIQ6AEwBQ#v =onepage&q=device%20drivers%20that%20manage%20powe r&f=false