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

Similar documents
Exam Review TexPoint fonts used in EMF.

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

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

Embedded Systems. 6. Real-Time Operating Systems

RT extensions/applications of general-purpose OSs

Schedulability with resource sharing. Priority inheritance protocol Priority ceiling protocol Stack resource policy

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

EMBEDDED OPERATING SYSTEMS

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

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

Real-Time Operating Systems (Working Draft) What is an Operating System (OS)?

EMERALDS: a small-memory real-time microkernel

REAL TIME OPERATING SYSTEM PROGRAMMING-I: VxWorks

Embedded Systems: OS

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

REAL-TIME OPERATING SYSTEMS SHORT OVERVIEW

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

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

Real-Time Systems. Real-Time Operating Systems

CEC 450 Real-Time Systems

ACM SOSP 99 paper by Zuberi et al.

Reference Model and Scheduling Policies for Real-Time Systems

Multiprocessor and Real-Time Scheduling. Chapter 10

Final Examination. Thursday, December 3, :20PM 620 PM. NAME: Solutions to Selected Problems ID:

6/17/2011. Real-time Operating Systems

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

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

REAL TIME OPERATING SYSTEM PROGRAMMING-II: II: Windows CE, OSEK and Real time Linux. Lesson-13: RT Linux

Systemy RT i embedded Wykład 11 Systemy RTOS

Operating Systems, Fall

OVERVIEW. Last Week: But if frequency of high priority task increases temporarily, system may encounter overload: Today: Slide 1. Slide 3.

Overall Structure of RT Systems

Deadlock. Lecture 4: Synchronization & Communication - Part 2. Necessary conditions. Deadlock handling. Hierarchical resource allocation

REAL-TIME OVERVIEW SO FAR MICHAEL ROITZSCH. talked about in-kernel building blocks:

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

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

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

Measuring the impacts of the Preempt-RT patch

Concurrency: Deadlock and Starvation

Real-Time & Embedded Operating Systems

Operating System Provides

Real-Time Operating Systems Design and Implementation. LS 12, TU Dortmund

Module 20: Multi-core Computing Multi-processor Scheduling Lecture 39: Multi-processor Scheduling. The Lecture Contains: User Control.

CS A331 Programming Language Concepts

RT3 - FreeRTOS Real Time Programming

Real-Time Programming

Real Time Systems: A Tutorial *

Analysis and Research on Improving Real-time Performance of Linux Kernel

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

Microkernel/OS and Real-Time Scheduling

CS A320 Operating Systems for Engineers

CEC 450 Real-Time Systems

Verification of Real-Time Systems Resource Sharing

CS4514 Real Time Scheduling

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

The Real Time Thing. What the hack is real time and what to do with it. 22C3 30. December Erwin Erkinger e.at

Advanced Operating Systems (CS 202) Scheduling (1)

Embedded & Real-time Operating Systems Communication Libraries

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

Introduction to Embedded Systems

Comparison of scheduling in RTLinux and RT-Mach Fredrik Löfgren frelo305 Dan Persson danpe454

An Evaluation of the Dynamic and Static Multiprocessor Priority Ceiling Protocol and the Multiprocessor Stack Resource Policy in an SMP System

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

NuttX Realtime Programming

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

Operating systems and concurrency (B10)

Multicore for safety-critical embedded systems: challenges andmarch opportunities 15, / 28

Real-time Support in Operating Systems

Chapter 5: CPU Scheduling

SMD149 - Operating Systems

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

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4

Lesson 5: Software for embedding in System- Part 2

Real-Time Systems 1. Basic Concepts

The OS Wars. Success

Resource-bound process algebras for Schedulability and Performance Analysis of Real-Time and Embedded Systems

EMERALDS: A Small-Memory Real-Time Microkernel

CSE 4/521 Introduction to Operating Systems


Deadlock. Concurrency: Deadlock and Starvation. Reusable Resources

Implementing Task Schedulers (1) Real-Time and Embedded Systems (M) Lecture 10

Resource Access Control (2) Real-Time and Embedded Systems (M) Lecture 14

A Minimal API For Support of Real-Time Operations. Abstract. Introduction. Necessary Qualities of a Real- Time Operating System

Multiprocessor and Real- Time Scheduling. Chapter 10

Priority Based Assignment of Shared resources in RTOS

Timers 1 / 46. Jiffies. Potent and Evil Magic

Resource management. Real-Time Systems. Resource management. Resource management

CS 153 Design of Operating Systems Winter 2016

CS140 Operating Systems Midterm Review. Feb. 5 th, 2009 Derrick Isaacson

Real Time Linux patches: history and usage

Operating Systems ECE344. Ding Yuan

EMERALDS: a small-memory real-time microkernel

Copyright Notice. COMP9242 Advanced Operating Systems S2/2014 Week 9: Real-Time Systems. Real-Time System: Definition

The Real-time Specification for Java

Real-Time Operating Systems

Real-Time Systems. Lecture #4. Professor Jan Jonsson. Department of Computer Science and Engineering Chalmers University of Technology

MARUTHI SCHOOL OF BANKING (MSB)

A Fully Preemptive Multiprocessor Semaphore Protocol for Latency-Sensitive Real-Time Applications

Transcription:

EECS 571 Principles of Real-Time Embedded Systems Lecture Note #10: More on Scheduling and Introduction of Real-Time OS Kang G. Shin EECS Department University of Michigan

Mode Changes Changes in mission phase or processor failures Easy to deal with if no critical section is involved A task may be added if o Addition preserves RM-schedulability o Raise ceilings before addition if it increases priority ceilings of any semaphore. Rules of changing ceiling: indivisible action when a semaphore is unlocked.

Quick Recovery from Failure Useful for static schedules: sufficient reserve capacity and fast failure-response mechanism. Incorporate ghost clones into schedule which can be activated when a processor on which a primary clone was scheduled crashes. 2 types of tasks affected by a processor failure o Running at time of failure FEC o Scheduled to run in future on the failed processor Assume there is a non-fault-tolerant algorithm for given assignment and scheduling

Fault-Tolerant Scheduling If up to f processor failures are to be withstood, each task must have f ghost clones A primary and a ghost clone of the same task cannot be allocated to the same processor A ghost schedule and a primary schedule are said to form a feasible pair if deadlines continue to be met even if primaries are shifted right by the time needed to execute ghosts

More on FT Scheduling Ghosts are conditionally transparent. They can overlap primary clones or other ghost clones in the schedule, subject to certain correctness restrictions. When a ghost clone is activated, the schedule is moved appropriately. A ghost clone is never moved.

Correctness Restrictions Primary clones moved by a ghost activation should still meet their deadlines Two ghosts may overlap so long as at most one of the two ghosts is activated.

Real-Time Operating Systems 4 main functions: o Process management and synchronization o Memory management o IPC o I/O Must support predictability and real-time constraints 3 types of RTOS: o small proprietary (homegrown and commercial) kernels o RT extensions to UNIX and others o research kernels

Proprietary Kernels Small and fast commercial RTOSs: QNX, psos, VxWorks, Nucleus, ERCOS, EMERALDS, Windows CE,... fast context switch and fast interrupt response small in size No virtual memory and can lock code & data in memory Multitasking and IPC via mailboxes, events, signals, and semaphores How to support real-time constraints o Bounded primitive exec time o real-time clock o priority scheduling o special alarms and timeouts Standardization via POSIX RT extensions

RT extensions RT-UNIX, RT-LINUX, RT-MACH, RT-POSIX Slower, less predictable, but more functions and better development envs. RT-POSIX: timers, priority scheduling, rt files, semaphores, IPC, async event notification, process mem locking, threads, async and sync I/O. Problems: coarse timers, system interface and implementation, long interrupt latency, FIFO queues, no locking pages in memory, no predictable IPC

Research RTOSs Support rt sched algorithms and timing analysis RT sync primitives, e.g., priority ceiling. Predictability over avg performance Support for fault-tolerance and I/O Examples: Spring, Mars, HARTOS, MARUTI, ARTS, CHAOS, EMERALDS

RT-Mach: Predictable Task Execution Tasks = RT-Mach threads Bounded blocking delays Real-time scheduling of threads o Hard periodic: p i, worst-case exec time e i, deadline d i. o Hard aperiodic: a i, e i, d i. o Soft periodic or aperiodic: abort times can be specified.

Thread Scheduling Scheduling Policies: Mach: RR, FP RT-Mach: RM, RM/DS, RM/SS, RM/PS Each thread can pick its own policy and go in the corresponding queue. Capacity Reserves: CPU cycles required by hard RT tasks first reserved Remaining cycles used for soft RT tasks

Thread Synchronization Priority inversion and solutions Implementation o Scenario: One thread in CS and many others waiting (in queue) to get in o Issues: Allow preemption in CS or not? Which thread to pick next from the queue? Preemption in CS: a thread inside CS may be non-preemptable, preemptable, and restartable

Synchronization Policies Kernelized Monitor (KM): non-preemptable mode Basic priority (BP): preemptable mode and priority scheduling Basic Priority Inheritance (BPI): BP + Priority Inheritance Priority Ceiling Protocol (PCP) o Priority ceiling of lock = priority of highest-priority thread that may lock this lock o Those threads execute which are associated with lock with highest-priority ceiling o avoids deadlock Restartable Critical Section (RCS): Restartable mode

Schedulability Analysis KM: Like EDF, except threads preemptable only when not in CS: n j=1 e j + e s p j 1 Priority Inheritance: Like RM, except lower priority thread can block higher-priority threads i B i p i + i j=1 e j p j i(2 1/i 1)

Which Policy is Best? KM: Good only if very short CS BP: Not good priority inversion PCP: Use if possibility of deadlock RCS: Use if high-priority thread cannot wait for CS and Restart costs are low. BPI: Simple and fast Use if no deadlock conditions and high-priority threads can wait for CS