Improving IPC by Kernel Design Jochen Liedtke Shane Matthews Portland State University.

Slides:



Advertisements
Similar presentations
Multiple Processor Systems
Advertisements

Threads, SMP, and Microkernels
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.
Improving IPC by Kernel Design Jochen Liedtke Slides based on a presentation by Rebekah Leslie.
MICRO-KERNELS New Generation Innovation. The contents Traditional OS view & its problems. Micro-kernel : introduction to concept. First generation micro-kernels.
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.
Computer Systems/Operating Systems - Class 8
Presented By Srinivas Sundaravaradan. MACH µ-Kernel system based on message passing Over 5000 cycles to transfer a short message Buffering IPC L3 Similar.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
CS533 Concepts of Operating Systems Class 6 Micro-kernels Mach vs L3 vs L4.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
User Level Interprocess Communication for Shared Memory Multiprocessor by Bershad, B.N. Anderson, A.E., Lazowska, E.D., and Levy, H.M.
Improving IPC by Kernel Design Jochen Liedtke Presented by Ahmed Badran.
Introduction to Kernel
Improving IPC by Kernel Design Jochen Liedtke Proceeding of the 14 th ACM Symposium on Operating Systems Principles Asheville, North Carolina 1993.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Threads CSCI 444/544 Operating Systems Fall 2008.
Microkernels: Mach and L4
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
Early OS security Overview by: Greg Morrisett Cornell University, Edited (by permission) for CSUS CSc250 by Bill Mitchell.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
1 I/O Management in Representative Operating Systems.
CS533 Concepts of Operating Systems Class 6 The Performance of Micro- Kernel Based Systems.
The Design of Robust and Efficient Microkernel ManRiX, The Design of Robust and Efficient Microkernel Presented by: Manish Regmi
The Mach System "Operating Systems Concepts, Sixth Edition" by Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne Presentation by Jonathan Walpole.
Operating Systems CSE 411 CPU Management Sept Lecture 11 Instructor: Bhuvan Urgaonkar.
Improving IPC by Kernel Design
Multiple Processor Systems. Multiprocessor Systems Continuous need for faster and powerful computers –shared memory model ( access nsec) –message passing.
1 Micro-kernel. 2 Key points Microkernel provides minimal abstractions –Address space, threads, IPC Abstractions –… are machine independent –But implementation.
8.4 paging Paging is a memory-management scheme that permits the physical address space of a process to be non-contiguous. The basic method for implementation.
From L3 to seL4 What Have We Learnt in 20 Years of L4 Microkernels? Embedded Lab. Kim Sewoog SOSP 2013.
CS533 Concepts of Operating Systems Jonathan Walpole.
The Performance of Micro-Kernel- Based Systems H. Haertig, M. Hohmuth, J. Liedtke, S. Schoenberg, J. Wolter Presentation by: Seungweon Park.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Multiple Processor Systems. Multiprocessor Systems Continuous need for faster computers –shared memory model ( access nsec) –message passing multiprocessor.
Processes Introduction to Operating Systems: Module 3.
The Mach System Abraham Silberschatz, Peter Baer Galvin, Greg Gagne Presentation By: Agnimitra Roy.
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
Middleware Services. Functions of Middleware Encapsulation Protection Concurrent processing Communication Scheduling.
The Performance of μ-Kernel-Based Systems H. Haertig, M. Hohmuth, J. Liedtke, S. Schoenberg, J. Wolter Presenter: Sunita Marathe.
Remote Procedure Call Andy Wang Operating Systems COP 4610 / CGS 5765.
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
Mark Stanovich Operating Systems COP Primitives to Build Distributed Applications send and receive Used to synchronize cooperating processes running.
The Mach System Silberschatz et al Presented By Anjana Venkat.
The Performance of Micro-Kernel- Based Systems H. Haertig, M. Hohmuth, J. Liedtke, S. Schoenberg, J. Wolter Presentation by: Tim Hamilton.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Brian Bershad, Thomas Anderson, Edward Lazowska, and Henry Levy Presented by: Byron Marohn Published: 1991.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
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.
Part IVI/O Systems Chapter 13: I/O Systems. I/O Hardware a typical PCI bus structure 2.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
WORKING OF SCHEDULER IN OS
Introduction to Kernel
The Mach System Sri Ramkrishna.
CS533 Concepts of Operating Systems
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Sarah Diesburg Operating Systems COP 4610
Main Memory Background Swapping Contiguous Allocation Paging
Improving IPC by Kernel Design
Fast Communication and User Level Parallelism
Improving IPC by Kernel Design
Presented by Neha Agrawal
Presented by: SHILPI AGARWAL
Improving IPC by Kernel Design
Operating Systems Structure
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
CSE 542: Operating Systems
Presentation transcript:

Improving IPC by Kernel Design Jochen Liedtke Shane Matthews Portland State University

3/12/2004 Portland State University Summary Review Performance improved –Architecture Level –Algorithmic Level –Interface Level –Coding Level

3 Micro-kernels Minimal OS, providing a set of primitives used to implement thread/address space management and IPC [1] Everything else is moved to user-space (servers)

4 Terminology (L3) Dataspace –Memory object, mapped into address space Task –Composed of threads, dataspaces, and an address space Message –String/memory object

5 L3 Architecture & IPC Active components communicate via messages Applies to: –Device drivers Implemented as user level tasks –Hardware Interrupts Interrupt message from micro-kernel to thread

6 L3 Redesign Principles IPC performance is the master –Security and performance must not be affected Synergetic effects taken into consideration –(Think combined effects) –May lead to reinforcement or diminution Design must aim at performance goal –Per short message transfer –350 cycles (7 micro-seconds)

3/12/2004 Portland State University Architectural Level Messages Process Structure Control Blocks

3/12/2004 Portland State University Compound Messages Multiple send/receive -> 1 send/receive Messages consists of direct/indirect strings, and memory objects

9 Twofold message copy [A space] -> [kernel] - > [B space] O( n) cycles, n:= bytes Good for small messages Need something better as n grows

10 LRPC and SRC RPC Client/server share user level memory –sender -> shared buffer Problems –When server to client is 1 to many, shared regions of address space become critical resources –Shared regions require explicit opens (unlike L3) –Message change during/after checking

11 Direct Message Copy Via Windows L3's method –Destination mapped into window –Message copied to window Window –per address space –Accessed exclusivly by kernel

12 Communication Windows Problems –Must be fast –Different threads coxisting within address space L3 Implementation –One word page directory B to A.

13 Process Structure Threads running kernel mode have 1 kernel stack per thread –Efficient since interupts, page faults, IPC, already save state on kernel stack Continuations –Pro: Reduce kernel stack –Cons: Require additional copies between kernel and continutation Interfere with other optimizations

14 Tread Control Blocks Implemented as large array in kernel –fast tcb access Array base + tcb # + tcb size –Saves TLB misses (IPC) kernel stacks of sender and reciever located in TCB page –Locking done via unmapping on TCB

3/12/2004 Portland State University Algorithmic Level Thread Identifier Lazy Scheduling Short Messages Via Registers

3/12/2004 Portland State University Thread Identifier Thread addressed by 64-bit UID in user- mode Thread number in lower 32-bits of UID –AND with bit mask, add to TCB’s array base

3/12/2004 Portland State University Lazy Scheduling IPC operation call or reply & receive next –Delete sending thread from ready queue –Insert into waiting queue –Delete receiving thread from waiting queue –Insert into ready queue Too many queue operations!

3/12/2004 Portland State University Lazy Scheduling cont. L3 queue invariants –Ready queue contains all ready threads –Waiting queue contains at least all threads waiting TCB contains threads state (ready/waiting) Scheduler removes all threads not belonging to queue during queue parsing

3/12/2004 Portland State University Short Messages Via Registers High proportion of messages are short –Ex. Driver ack/error, hardware interrupts 486 –7 general registers –3 needed: sender ID, result code –4 available 8-byte messages using coding scheme

3/12/2004 Portland State University Interface Level Simple RPC stubs –Load registers, system call, check success –Compiler generates stubs inline Parameter Passing –Use registers when possible

3/12/2004 Portland State University Coding Level Reduce cache and TLB misses –Short kernel code Short jumps, use registers, short address displacements –IPC kernel code in one page –Handle save/restore of coprocessor lazily Delayed until different thread needs to use it

3/12/2004 Portland State University Results 100% would indicate double the time increase Removal of all increase IPC time by 134% for 8 byte message

3/12/2004 Portland State University Results L3 VS Mach System –Intel 486 DX-50 –256 KB external cache –16 MB memory

3/12/2004 Portland State University Results cont.

3/12/2004 Portland State University Conclusions IPC improved by applying –Performance based reasoning –Synergetic effects –Architecture -> coding

26 References [1] [2] Improving IPC by Kernel Design - Jochen Liedtke