Tiny OS Optimistic Lightweight Interrupt Handler Simon Yau Alan Shieh

Slides:



Advertisements
Similar presentations
How to use TinyOS Jason Hill Rob Szewczyk Alec Woo David Culler An event based execution environment for Networked Sensors.
Advertisements

Sensor Network Platforms and Tools
The Kernel Abstraction. Challenge: Protection How do we execute code with restricted privileges? – Either because the code is buggy or if it might be.
Chapter 6 Limited Direct Execution
1 OS Structure, Processes & Process Management. 2 Recap OS functions  Coordinator  Protection  Communication  Resource management  Service provider.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
ECE 526 – Network Processing Systems Design Software-based Protocol Processing Chapter 7: D. E. Comer.
Thursday, June 08, 2006 The number of UNIX installations has grown to 10, with more expected. The UNIX Programmer's Manual, 2nd Edition, June, 1972.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan.
Tiny OS Optimistic Lightweight Interrupt Handler Simon Yau Alan Shieh CS252, CS262A, Fall The.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
OS Spring’03 Introduction Operating Systems Spring 2003.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
1 When to Switch Processes 3 triggers –System call, Interrupt and Trap System call –when a user program invokes a system call. e.g., a system call that.
1 EE249 Discussion System Architecture Directions for Networked Sensors (J. Hill, et al) Presented By: Sarah Bergbreiter EE249 Discussion Section October.
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.
Spring 2000, 4/27/00 Power evaluation of SmartDust remote sensors CS 252 Project Presentation Robert Szewczyk Andras Ferencz.
3/11/2002CSE Input/Output Input/Output Control Datapath Memory Processor Input Output Memory Input Output Network Control Datapath Processor.
Protection and the Kernel: Mode, Space, and Context.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Chapter 2: Computer-System Structures 2.1 Computer System Operation 2.5 Hardware Protection 2.6 Network Structure.
Scheduling Example 3 (1) Assume: FIFO Job Scheduling 100 K Main Memory Processor Sharing Process Scheduling (Cont…)
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.
Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection Network Structure.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
System Architecture of Sensor Network Processors Alan Pilecki.
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presenter: James.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Oindrila.
Lecture Topics: 10/29 Architectural support for operating systems –timers –kernel mode –system calls –protected instructions.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Managing Processors Jeff Chase Duke University. The story so far: protected CPU mode user mode kernel mode kernel “top half” kernel “bottom half” (interrupt.
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
System Architecture Directions for Networked Sensors.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Interrupts and Interrupt Handling David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Chapter 6 Limited Direct Execution Chien-Chung Shen CIS/UD
Preventing Interrupt Overload Presented by Jiyong Park Seoul National University, Korea John Regehr, Usit Duogsaa, School of Computing, University.
INTRODUCTION TO WIRELESS SENSOR NETWORKS
Introduction to Operating Systems
CS 3214 Computer Systems Lecture 9 Godmar Back.
Introduction to Operating Systems
Memory Protection: Kernel and User Address Spaces
Windows API.
Realtime Linux Clark Williams Tech Lead
CS490 Windows Internals Quiz 2 09/27/2013.
Intro to Processes CSSE 332 Operating Systems
Interrupts and Interrupt Handling
Memory Protection: Kernel and User Address Spaces
Introduction to Operating Systems
Memory Protection: Kernel and User Address Spaces
Memory Protection: Kernel and User Address Spaces
Computer-System Architecture
Direct Memory Access Disk and Network transfers: awkward timing:
Lecture Topics: 11/1 General Operating System Concepts Processes
Architectural Support for OS
EE 472 – Embedded Systems Dr. Shwetak Patel.
Implementing Processes, Threads, and Resources
Architectural Support for OS
Outline Process Management Process manager Hardware process
Interrupts and Interrupt Handling
Memory Protection: Kernel and User Address Spaces
Presentation transcript:

Tiny OS Optimistic Lightweight Interrupt Handler Simon Yau Alan Shieh

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

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

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

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

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

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

Software Register Window R31 R30 R29 R28 R27 R26 R25 R24 R20-R23 R16-R19 R8-R15 R2-R7 R1 R0 Shared registers User registers Interrupt registers

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)

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.

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.

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

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

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…

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