Real Time Linux Who Needs It? Presented by: Steven Rostedt

Slides:



Advertisements
Similar presentations
Introduction to Embedded Systems Resource Management - III Lecture 19.
Advertisements

Secure Operating Systems Lesson 5: Shared Objects.
Interprocess Communication
INSE - Lectures 19 & 20 SE for Real-Time & SE for Concurrency  Really these are two topics – but rather tangled together.
Embedded and Real-time Operating Systems The suitability of Linux.
Embedded and Real Time Systems Lecture #4 David Andrews
Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson.
CS533 Concepts of Operating Systems Class 7 Integrated Task and Stack Management.
Comparative Operating Systems Fall 2001 An Examination of Embedded Linux as a Real Time Operating System Mark Mahoney.
Real-Time Operating Systems Suzanne Rivoire November 20, 2002
1 Previous lecture review n Out of basic scheduling techniques none is a clear winner: u FCFS - simple but unfair u RR - more overhead than FCFS may not.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
Beyond CRTS Miranda Technologies Chris Pringle. Agenda Introduction About Miranda My Role Real Time Systems Crashing Nightmares Software Design in the.
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
A life in Engineering Miranda Technologies Chris Pringle.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
Fall 2013 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Real-Time, Clocking, and Porting (My Job ) Determining the Real Time Capabilities of various Operating Systems. Writing code to support Real Time Clocking.
1 Review of Process Mechanisms. 2 Scheduling: Policy and Mechanism Scheduling policy answers the question: Which process/thread, among all those ready.
CSCI1600: Embedded and Real Time Software Lecture 27: Real Time Linux Steven Reiss, Fall 2015.
Supporting Time Sensitive Application in a Commodity OS Ashvin Goel, Luca, Charles, Jim, Jonathan Walpole Oregon Graduate Institute, Portland Presented.
Introduction to Embedded Systems Rabie A. Ramadan 5.
Real Time System with MVL. © 2007 MontaVista Confidential | Overview of MontaVista Agenda Why Linux Real Time? Linux Kernel Scheduler Linux RT technology.
Low Overhead Real-Time Computing General Purpose OS’s can be highly unpredictable Linux response times seen in the 100’s of milliseconds Work around this.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
Where Testing Fails …. Problem Areas Stack Overflow Race Conditions Deadlock Timing Reentrancy.
Interrupt Handler Migration and Direct Interrupt Scheduling for Rapid Scheduling of Interrupt-driven Tasks Reviewer: Kim, Hyukjoong ESLab.
CONCEPTS OF REAL-TIME OPERATING SYSTEM. OBJECTIVE  To Understand Why we need OS?  To identify Types of OS  To Define Real - Time Systems  To Classify.
Real-Time Operating Systems RTOS For Embedded systems.
Copyright © 2010 K Computing Use of RT-Preempt Kevin Dankwardt, Ph.D. K Computing
Inside The RT Patch Steven Rostedt (Red Hat) Darren V Hart (IBM) Talk: Benchmarks :
© 2013 MontaVista Software, LLC. MontaVista Confidential and Proprietary. CGE7 DevRocket7 Feature Demo Divya Vyas.
Ftrace Tutorial Steven Rostedt
Inside The RT Patch Steven Rostedt (Red Hat) Darren V Hart (IBM) Talk: Benchmarks :
Real Time patch BOF on OLS Friday, July 21, :00 – 13:45 Room D Steven Rostedt Klaas van Gend.
Inside The RT Patch Steven Rostedt (Red Hat) Darren V Hart (IBM) Talk: Benchmarks :
Real-Time Linux Pacific Northwest National Labs Rick Lindsley 4/6/09
Introduction to Real-Time Operating Systems
REAL-TIME OPERATING SYSTEMS
Chapter 19: Real-Time Systems
Lecture 12: Real-Time Scheduling
Yoav Etsion, Dan Tsafrir, Dror G. Feitelson
CS 6560: Operating Systems Design
Albert M. K. Cheng Embedded Real-Time Systems
Realtime Linux Clark Williams Tech Lead
Wayne Wolf Dept. of EE Princeton University
Unit OS9: Real-Time and Embedded Systems
Kernel Tracing David Ferry, Chris Gill
Introduction to Open Architecture for Real-Time Systems Dr
Semester Review Chris Gill CSE 422S - Operating Systems Organization
Lecture 4 Schedulability and Tasks
Real Time Operating System
CSCI1600: Embedded and Real Time Software
Realtime Scheduling Algorithms
Real-Time Operating Systems
CS4101 嵌入式系統概論 RTOS Prof. Chung-Ta King Department of Computer Science
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Lecture Topics: 11/1 General Operating System Concepts Processes
Real-time Linux Evaluation
CPU scheduling decisions may take place when a process:
Processes and operating systems
Midterm Review Brian Kocoloski
Operating Systems Real-Time Operating Systems
Time Sources and Timing
Kernel Tracing David Ferry, Chris Gill, Brian Kocoloski
Supporting Time-Sensitive Applications on a Commodity OS
CS703 - Advanced Operating Systems
RTOS Modelling Naren Bala.
Embedded System Development Lecture 12 4/4/2007
Linux Scheduling CSE 2431: Introduction to Operating Systems
Presentation transcript:

Real Time Linux Who Needs It? Presented by: Steven Rostedt

What is Real Time? ● Real Time Clock? ● Real Time Video? ● Real Time Delivery? ● Real Time Operating System? ● Real Time Presentation Translation?

What is Real Time? ● Real Time Clock? ● Real Time Video? ● Real Time Delivery? ● Real Time Operating System? ● Real Time Presentation Translation?

What is a Real Time Operating System? ● Faster? ● Real Time does not mean fast! NO ! ● What does a RTOS give us? – Deterministic

What does being Deterministic Give Us? ● Repeatability ● Reliable Results ● Known Worst Cases ● Known Reaction Times

Real Time Hard vs Soft ● Hard Real Time – Mathematically proven ● Given a set of inputs, always gives the same output at the same time – Must be small (~5000 lines of code) – Bounded Latencies ● Soft Real Time – Can deal with outliers – Tries to be reliable – Unbounded Latencies

Examples of Users of Hard Real Time ● Airplane Engine Controls ● Nuclear Power Plants ● Mars Lander ● Shuttle

Examples of Soft Real Time Users ● Video Systems ● Video Games ● Some Communication Systems Vanilla Linux is a Soft Real Time System

Real Time Linux ● Is it a Soft Real Time System? – Does not allow for outliers ● Those few cases that happen outside the Maximum – Has Bounded Latency ● Is it a Hard Real Time System? – Not a small system – Can not be mathematically proven ● What is Real Time Linux then? – Hard Real Time Designed

Real Time Linux ● Can not be mathematically proven – It is too big ● Tries very hard to bound all latencies – Any time an unexpected latency is found, it is considered a bug ● The Design of RT Linux follows the same as a Hard Real Time OS design

Who Uses Real Time Linux? ● Financial Industries – code already too big for true Hard Real Time – Can not miss deadlines ● Audio Recordings – A latency will ruin a good performance ● Can not fail but... – Nobody dies if it does

What RT Linux Gave to Vanilla Linux ● High Resolution Timers ● Generic Interrupt Design – Cleaned up the code ● Preemptible RCU Locks ● Real Time Scheduler ● Priority Inheritance (on user space locks) ● Ftrace - Linux Kernel Tracer

What Is Left? ● Interrupts as Threads – Helps against Interrupt Inversion Latencies ● Spin locks to sleeping mutexes – Interrupts do not need to be disabled – Helps against reaction time Latencies ● Task wake up ● Timer response ● Priority Inheritance on kernel locks – Helps against Priority Inversion Latencies

What is Latency? ● The time between when an event is expected to happen, and the time it happens ● Causes of Latency – Interrupts disabled – Interrupt executing – Slow scheduler

Interrupts

Interrupts Disabled

Interrupt Inversion

Threaded Interrupts

# ps ax |grep IRQ 42 ? S< 0:00 [IRQ-9] 56 ? S< 0:00 [IRQ-12] 57 ? S< 0:00 [IRQ-1] 59 ? S< 0:00 [IRQ-8] 67 ? S< 0:00 [IRQ-19] 74 ? S< 0:00 [IRQ-16] 75 ? S< 0:00 [IRQ-17] 76 ? S< 0:00 [IRQ-18] 138 ? S< 0:00 [IRQ-28] 447 ? S< 0:00 [IRQ-3] 920 ? S< 0:00 [IRQ-14] 922 ? S< 0:00 [IRQ-15] 1935 ? S< 0:00 [IRQ-29] 1937 ? S< 0:00 [IRQ-30]

Latency ● Latency always happens – It takes code to execute ● Bounded latency – We know the worst case (the biggest latency) ● Unbounded Latency – No idea of how long it will last – Classic case ● Priority Inversion

Priority Inversion

Priority Inheritance

Vanilla Linux # cyclictest -t1 -p95 -n -i1000 -o10 -v |./oscilloscope-cmd.py & # hackbench 50

RT Linux rt22 # cyclictest -t1 -p95 -n -i1000 -o10 -v |./oscilloscope-cmd.py & # hackbench 50

Latency Tracer Vanilla # tracer: irqsoff # irqsoff latency trace v1.1.5 on vanilla latency: 644 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | task: sh-4075 (uid:500 nice:0 policy:0 rt_prio:0) # _------=> CPU# # / _-----=> irqs-off # | / _----=> need-resched # || / _---=> hardirq/softirq # ||| / _--=> preempt-depth # |||| / # ||||| delay # cmd pid ||||| time | caller # \ / ||||| \ | / sh d... 1us!: _write_lock_irq (release_task) sh d us : _write_unlock_irq (release_task) sh d us : trace_hardirqs_on (release_task)

Latency Tracer Vanilla rt22 # tracer: irqsoff # # irqsoff latency trace v1.1.5 on rt22 # # latency: 41 us, #3/3, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) # # | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0) # # # _------=> CPU# # / _-----=> irqs-off # | / _----=> need-resched # || / _---=> hardirq/softirq # ||| / _--=> preempt-depth # |||| / # ||||| delay # cmd pid ||||| time | caller # \ / ||||| \ | / -0 1d..1 1us+: acpi_idle_enter_bm <-cpuidle_idle_call -0 1d..1 41us : acpi_idle_enter_bm <-cpuidle_idle_call -0 1d..1 42us : stop_critical_timings <-cpuidle_idle_call

Hardware Does Matter! ● Cache and TLB misses can cause unpredictable results ● SMI - System Management Interrupt – Controlled by the BIOS – The Operating System has no control and no idea they happen ● The hardware must also be deterministic

More info This slide: rt-linux-who-needs-it.odp

Ftrace A little demo on a development kernel (not a Real Time kernel)