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.

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Bilgisayar Mühendisliği Bölümü GYTE - Bilgisayar Mühendisliği Bölümü Multithreading the SunOS Kernel J. R. Eykholt, S. R. Kleiman, S. Barton, R. Faulkner,
Presented By Srinivas Sundaravaradan. MACH µ-Kernel system based on message passing Over 5000 cycles to transfer a short message Buffering IPC L3 Similar.
Chapter 5 Processes and Threads Copyright © 2008.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
1 CS318 Project #3 Preemptive Kernel. 2 Continuing from Project 2 Project 2 involved: Context Switch Stack Manipulation Saving State Moving between threads,
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
CMPT 300: Operating Systems Review THIS REIVEW SHOULD NOT BE USED AS PREDICTORS OF THE ACTUAL QUESTIONS APPEARING ON THE FINAL EXAM.
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
3.5 Interprocess Communication
Improving IPC by Kernel Design Jochen Liedtke Shane Matthews Portland State University.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
Chapter 11 Operating Systems
CS533 Concepts of Operating Systems Class 3 Integrated Task and Stack Management.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
CprE 458/558: Real-Time Systems
OS and the Computer System  Some OS programs exist permanently in the system area of the memory to monitor and control activities in the computer system.
CS 3013 & CS 502 Summer 2006 Threads1 CS-3013 & CS-502 Summer 2006.
ThreadsThreads operating systems. ThreadsThreads A Thread, or thread of execution, is the sequence of instructions being executed. A process may have.
Dreams in a Nutshell Steven Sommer Microsoft Research Institute Department of Computing Macquarie University.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Memory Management in Windows and Linux &. Windows Memory Management Virtual memory manager (VMM) –Executive component responsible for managing memory.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
1 Micro-kernel. 2 Key points Microkernel provides minimal abstractions –Address space, threads, IPC Abstractions –… are machine independent –But implementation.
Scheduling Basic scheduling policies, for OS schedulers (threads, tasks, processes) or thread library schedulers Review of Context Switching overheads.
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.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
The Performance of Micro-Kernel- Based Systems H. Haertig, M. Hohmuth, J. Liedtke, S. Schoenberg, J. Wolter Presentation by: Seungweon Park.
30 October Agenda for Today Introduction and purpose of the course Introduction and purpose of the course Organization of a computer system Organization.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
Threads G.Anuradha (Reference : William Stallings)
Fall 2013 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
The Performance of μ-Kernel-Based Systems H. Haertig, M. Hohmuth, J. Liedtke, S. Schoenberg, J. Wolter Presenter: Sunita Marathe.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
CS399 New Beginnings Jonathan Walpole. 2 Concurrent Programming & Synchronization Primitives.
BeOS AJ Schuster Robert Robinson Nicole Chung Brian Hoffman.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Chapter 3 Operating Systems. © 2005 Pearson Addison-Wesley. All rights reserved 3-2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems.
Processes. Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Operating Systems: Summary INF1060: Introduction to Operating Systems and Data Communication.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Introduction to threads
Module 12: I/O Systems I/O hardware Application I/O Interface
Processes and threads.
Process Management Process Concept Why only the global variables?
CS 6560: Operating Systems Design
Section 10: Last section! Final review.
Threads & multithreading
Chapter 3: Windows7 Part 2.
Chapter 3: Windows7 Part 2.
Operating System Concepts
CS703 - Advanced Operating Systems
Architectural Support for OS
Translation Buffers (TLB’s)
EE 472 – Embedded Systems Dr. Shwetak Patel.
Major Topics in Operating Systems
LINUX System : Lecture 7 Lecture notes acknowledgement : The design of UNIX Operating System.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Translation Buffers (TLB’s)
CS333 Intro to Operating Systems
Architectural Support for OS
Translation Buffers (TLBs)
CS 5204 Operating Systems Lecture 5
Presentation transcript:

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 by isolating from interrupts and other processes and kernel threads Put as much functionality into user space as possible

User Space Functionality Memory map hardware and clocks, and handle interrupts in user space Use shared memory for IPC Memory map special kernel pages or use virtual system calls Do uncontended locking with IRIX usyncs or Linux futuxes

Mutex Protocol Performance

Overview - General Purpose OS’s are complicated and unpredictable - Good RT performance may be had by protecting cpu’s from outside interference - User level interfaces to common features further reduce latency and unpredictability - Summary: Lock out and avoid as much of the kernel as possible

Methods of Blocking Interruptions - Restrict cpu’s to specific threads - Isolate cpu’s from TLB and cache invalidations - Direct hardware interrupts elsewhere - Turn off the timeshare scheduling interrupt - Ward off any remaining kernel background tasks

Lock in User Space When Possible - IRIX  usyncs and Linux  futexes attempt to handle most locking actions with atomic primitives outside the kernel - Contended locks force accessors into the kernel to use wait queues - Usually just costs a few instructions vs entering and leaving the kernel for a free lock

SGI  IRIX  Non-preemptive Mutexes - Priority Inheritance and Priority Ceiling both have overhead even with uncontended locks - IRIX non-preemptive mutexes provide pseudo - priority ceiling protection by preventing a lock holder from being preempted by any other thread - Lock holders are required to yield the cpu if they prevented an actual preemption attempt - The two varieties of non-preemptive mutexes protect against other pthreads in the same process and against any threads in the system

Non-preemptive mutex performance

Provide Direct Access to Hardware - Memory map or allow programmed I/O access to hardware features - Example: mmap() the Real-Time Clock - 380ns clock_gettime() vs 2.4us from the kernel - Example: mmap() a PCI device - full register level access from user space

User Level Interrupts - Handle hardware interrupts in user space asynchronously - Works great with memory mapped hardware us to wake a waiting user thread us to handle with a User Level Interrupt

Direct I/O - Bypass the buffer cache by directly writing to and reading from user space to disk - Eliminates memory copies and kernel overhead - Allows the process to implement its own caching algorithm

Inter Process Communication - Place message queues in shared memory areas - 2.9us to enqueue a message in shared memory - 6.7us to enqueue a message through the kernel

Memory Map the Kernel - Provide useful per-thread data in special mapped pages of kernel memory - Provides quick access to the current cpu ID, and scheduling and timing information - Provides a window for the thread to indicate its signal mask and scheduling hints without entering the kernel

Context Switches - Some pthread implementations map multiple pthreads onto the same kernel thread - Some things like signals become difficult but the benefit is that the kernel is less involved - Many to one mapped pthreads can context switch in 1.6us vs 27.2us for one to one