ACM SOSP 99 paper by Zuberi et al.

Similar documents
EMERALDS: a small-memory real-time microkernel

EMERALDS: A Small-Memory Real-Time Microkernel

EMERALDS: a small-memory real-time microkernel

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #10: More on Scheduling and Introduction of Real-Time OS

Commercial Real-time Operating Systems An Introduction. Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory

Exam Review TexPoint fonts used in EMF.

Systemy RT i embedded Wykład 11 Systemy RTOS

OPERATING SYSTEM CONCEPTS UNDERSTAND!!! IMPLEMENT!!! ANALYZE!!!

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

Real-Time Programming

Embedded Systems. 6. Real-Time Operating Systems

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9

AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel. Alexander Züpke, Marc Bommert, Daniel Lohmann

Real-Time & Embedded Operating Systems

REAL TIME OPERATING SYSTEM PROGRAMMING-I: VxWorks

Embedded Systems: OS. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Embedded Systems. 5. Operating Systems. Lothar Thiele. Computer Engineering and Networks Laboratory

CS4514 Real Time Scheduling

Embedded Systems: OS

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

EMBEDDED OPERATING SYSTEMS

Real-Time Systems Hermann Härtig Real-Time Operating Systems Brief Overview

REAL-TIME OPERATING SYSTEMS SHORT OVERVIEW

RTOS Real T i Time me Operating System System Concepts Part 2

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture

SE300 SWE Practices. Lecture 10 Introduction to Event- Driven Architectures. Tuesday, March 17, Sam Siewert

NuttX Realtime Programming

Multiprocessor and Real-Time Scheduling. Chapter 10

Real-Time Systems. Real-Time Operating Systems

SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE) UNIT I OPERATING SYSTEMS

* There are more than 100 hundred commercial RTOS with memory footprints from few hundred kilobytes to large multiprocessor systems

Operating Systems, Fall

Department of Computer Science Institute for System Architecture, Operating Systems Group REAL-TIME MICHAEL ROITZSCH OVERVIEW

Real-Time Component Software. slide credits: H. Kopetz, P. Puschner


CEC 450 Real-Time Systems

TDDD07 Real-time Systems Lecture 10: Wrapping up & Real-time operating systems

Sistemas Operacionais I. Valeria Menezes Bastos

UNIT I [INTRODUCTION TO EMBEDDED COMPUTING AND ARM PROCESSORS] PART A

Operating Systems Design Fall 2010 Exam 1 Review. Paul Krzyzanowski

DSP/BIOS Kernel Scalable, Real-Time Kernel TM. for TMS320 DSPs. Product Bulletin

6/17/2011. Real-time Operating Systems

Performance and Optimization Issues in Multicore Computing

Multiprocessor Systems. COMP s1

Introduction to Embedded Systems

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Process Description and Control

Towards a Resilient Operating System for Wireless Sensor Networks

Operating Systems : Overview

Input and Output = Communication. What is computation? Hardware Thread (CPU core) Transforming state

Reference Model and Scheduling Policies for Real-Time Systems

CPU Architecture. HPCE / dt10 / 2013 / 10.1

SWE 760 Lecture 1: Introduction to Analysis & Design of Real-Time Embedded Systems

CSE 120 PRACTICE FINAL EXAM, WINTER 2013

Multimedia Systems 2011/2012

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst

CHAPTER 3 LabVIEW REAL TIME APPLICATION DEVELOPMENT REFERENCES: [1] NI, Real Time LabVIEW. [2] R. Bishop, LabVIEW 2009.

(b) External fragmentation can happen in a virtual memory paging system.

Chapter 5A. Large and Fast: Exploiting Memory Hierarchy

Non-Blocking Write Protocol NBW:

The MOSIX Scalable Cluster Computing for Linux. mosix.org

MARUTHI SCHOOL OF BANKING (MSB)

Virtual Memory Outline

Process Description and Control

Integrating Concurrency Control and Energy Management in Device Drivers. Chenyang Lu

Multiprocessor System. Multiprocessor Systems. Bus Based UMA. Types of Multiprocessors (MPs) Cache Consistency. Bus Based UMA. Chapter 8, 8.

Caching and reliability

6.033 Spring Lecture #6. Monolithic kernels vs. Microkernels Virtual Machines spring 2018 Katrina LaCurts

Lesson 5: Software for embedding in System- Part 2

Model Based Development of Embedded Control Software

Process Monitoring in Operating System Linux

I/O Systems. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

Concurrency: Deadlock and Starvation

即時控制系統設計 Design of Real-Time Control Systems

Embedded Linux Architecture

Dealing with Issues for Interprocess Communication

Process Coordination and Shared Data

CHAPTER 3 - PROCESS CONCEPT

Operating Systems. Lecture 4 - Concurrency and Synchronization. Master of Computer Science PUF - Hồ Chí Minh 2016/2017

GFS: The Google File System

Intertask Communication

Linux (Fedora or Slackware) CPU Scheduling

A Predictable RTOS. Mantis Cheng Department of Computer Science University of Victoria

Memory management. Knut Omang Ifi/Oracle 10 Oct, 2012

Predictable Interrupt Management and Scheduling in the Composite Component-based System

The Multikernel: A new OS architecture for scalable multicore systems Baumann et al. Presentation: Mark Smith

Donn Morrison Department of Computer Science. TDT4255 Memory hierarchies

Virtual machines (e.g., VMware)


Improved Analysis and Evaluation of Real-Time Semaphore Protocols for P-FP Scheduling

Operating System Design Issues. I/O Management

I/O Systems. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

CS 4284 Systems Capstone

Static Analysis of Embedded C

CSE398: Network Systems Design

Real-Time Systems 1. Basic Concepts

CS 31: Introduction to Computer Systems : Threads & Synchronization April 16-18, 2019

Chapter 19: Real-Time Systems. Operating System Concepts 8 th Edition,

CS2506 Quick Revision

Comparison of scheduling in RTLinux and QNX. Andreas Lindqvist, Tommy Persson,

Transcription:

ACM SOSP 99 paper by Zuberi et al.

Motivation Overview of EMERALDS Minimizing Code Size Minimizing Execution Overheads Conclusions 11/17/10 2

Small-memory embedded systems used everywhere! automobiles home appliances telecommunication devices, PDAs, factory automation and avionics Massive volumes (10K-10M units per annum) Saving even a few dollars per unit is important: cheap, low-end processors (Motorola 68K, Hitachi SH-2) max. 32-64 KB SRAM, often on-chip low-cost networks, e.g., Controller Area Network (CAN) 11/17/10 3

Despite restrictions, must perform increasingly complex functions General-purpose RTOSs (VxWorks, psos, QNX) too large or inefficient Some vendors provide smaller RTOSs (psos Select, RTXC, Nucleus) by carefully handcrafting code to get efficiency 11/17/10 4

Code size ~ 20 kb Must provide all basic OS services: process management, IPC, task synchronization, scheduling, I/O All aspects must be re-engineered to suit smallmemory embedded systems: API IPC, synchronization, and other OS mechanisms Task scheduling Networking 11/17/10 5

Extensible Microkernel for Embedded ReAL-time Distributed Systems 11/17/10 6

Location of resources known allocation of threads on nodes compile-time allocation of mailboxes => no naming services Memory-resident applications: no disks or file systems Simple messages e.g., sensor readings, actuator commands often can directly interact with network device driver 11/17/10 7

Task Scheduling: EDF/RM can ``consume 10-15% of CPU Task Synchronization: semaphore operations incur context switch overheads Intertask Communication: often exchange 1000 s of short messages, especially if OO is used 11/17/10 8

Problems with cyclic time-slice schedulers Poor aperiodic response time Long schedules Problems with common priority-driven schedulers EDF: High run-time overheads RM: High schedulability overheads 11/17/10 9

Run-time Overheads: Execution time of scheduler RM: static priorities, low run-time overheads EDF: high run-time overheads Schedulability Overhead: 1 - U* U* is ideal utilization attainable, assuming no run-time overheads EDF: U* = 1 (no schedulability overhead) RM: U* > 0.69 with avg. 0.88 Total Overhead: Sum of these overheads Combined static/dynamic (CSD) scheduler finds a balance between RM and EDF 11/17/10 10

Example of RM schedulability issue U = 0.88; EDF schedulable, but not under RM T 1 T 2 T 3 T 4 T 1 T 2 T 3 T 4 T 5 misses deadline 0 1 2 3 4 5 6 7 8 time 11/17/10 11

CSD maintains two task queues: Dynamic Priority (DP) scheduled by EDF Fixed Priority (FP) scheduled by RM Given workload {T i : i = 1,2,...,n } sorted by RMpriority Let r be smallest index such that T r +1 - T n are RMschedulable T 1 - T r are in DP queue T r +1 - T n are in FP queue DP is given priority over FP queue 11/17/10 12

CSD has near zero schedulability overhead Most EDF schedulable task sets can work under CSD Run-time overheads lower than EDF r-long vs. n-long DP queue FP tasks incur only RM-like overhead Reducing CSD overhead further split DP queue into multiple queues shorter queues for dynamic scheduling need careful allocation, since schedulability overhead incurred between DP queues 11/17/10 13

Comparison of CSD-x, EDF, and RM 20-40% lower overhead than EDF for 20-30 tasks CSD-x improves performance, but diminishing returns 11/17/10 14

Concurrency control among tasks May cause a large number of context switches Typical scenario: Tx>T2 > T1 and T1 is holding lock unblock T 2 context switch C 1 T 2 calls acquire_sem() priority inheritance (bump-up T 1 to T 2 s) block T 2 context switch C 2 T 1 calls release_sem() undo T 1 priority inheritance unblock T 2 context switch C 3 11/17/10 15

For each acquire_sem(s) call: pass S as an extra parameter to blocking call if S unavailable at end of call, stay blocked unblock when S is released acquire_sem(s) succeeds without blocking 11/17/10 16

For DP tasks, change one variable, since they are in unsorted queue For FP tasks, must remove T 1 from queue and reinsert according to new priority assignment Solution: switch positions of T 1 and T 2 Avoids parsing queue Since T 2 is blocked, can be put anywhere as position holder to remember T 1 s original position 11/17/10 17

DP tasks - fewer context switches FP tasks - optimized PI steps FP Tasks DP Tasks 11/17/10 18

Tasks in embedded systems may need to exchange 1000 s of short messages per second, e.g., OO Traditional IPC mechanisms (e.g., mailbox-based IPC) do not work well high overheads no broadcast to send to multiple receivers For efficiency, application writers forced to use global variables to exchange information unsafe if access to global variables is not regulated 11/17/10 19

Uses single-writer, multiple-reader paradigm Writer-associated state message mailbox (SMmailbox) A new message overwrites previous message Reads do not consume messages Reads and writes are non-blocking, synchronization-free Read and write operations through user-level macros Much less overhead than traditional mailboxes A tool generates customized macros for each state message 11/17/10 20

Problem with global variables: a reader may read a half-written message as there is no synchronization Solution: N-deep circular message buffer for each state message Pointer is updated atomically after write if writer has period 1 ms and reader 5 ms, then N=6 suffices New Problem: N may need to be in the 100 s 11/17/10 21

Writers and normal readers use user-level macros Slow readers use atomic read system call N depends only on faster readers (saves memory) 11/17/10 22

Needed for fault-tolerance, isolating SW bugs Embedded tasks have small memory footprints use only 1 or 2 page tables from lowest level of hierarchy use common upper-level tables to conserve kernel memory Map kernel into all task address spaces Minimize user-kernel copying as task data and pointers accessible to kernel Reduce system call overheads to a little more than for function calls 11/17/10 23

OSEK OS standard consists of API: system call interface Internal OS algorithms: scheduling and semaphores OSEK Communication standard (COMM) is based on CAN Developed an OSEK-compliant version of EMERALDS for Hitachi SH-2 microprocessor 11/17/10 24

Features Optimized context switching for basic and extended tasks Optimized RAM usage Developed OSEK-COMM over CAN for EMEMRALDS-OSEK Hitachi s application development and evaluation: collision-avoidance and adaptive cruise control systems 11/17/10 25

Small, low-cost embedded systems place stringent constraints on OS efficiency and size EMERALDS achieves good performance by redesigning basic services for such embedded systems Scheduling overhead reduced 20-40% Semaphore overheads reduced 15-25% Messaging passing overheads 1/4 to 1/5 that of mailboxes complete code ~ 13 kb 11/17/10 26

Implemented on Motorola 68040 Ported to 68332, PPC, x86, and strong ARM Also investigated networking issues: devicenet, wireless LANs, rt-ethernet, TCP and UDP/IP OS-dependent and independent development tools Energy-Aware EMERALDS extend to support energy saving hardware (DVS, sprint & halt) Energy-aware storage systems (momory and disks) Energy-aware Quality of Service (EQoS) Applications to info appliances and home networks 11/17/10 27

RTAS 96 - original EMERALDS RTAS 97 - semaphore optimizations NOSSDAV 98 - protocol processing optimizations SAE 99 - EMERALDS-OSEK SOSP 99 - EMERALDS with re-designed services RTSS 00 Energy-aware CSD IEEE-TSE 00 complete version with schedulability analysis SOSP 01- Exploitation of DVS ACM TECS (pending) - EQoS UNSENIX 03, PACS 04: power-aware memory SOSP 05: high-performnace, low-power disk I/O USENIX 02 totally non-blocking IPC URL: http://kabru.eecs.umich.edu/rtos 11/17/10 28