Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
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.
Scheduler Activations: Effective Kernel Support for the User-level Management of Parallelism Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska,
CPU Review and Programming Models CT101 – Computing Systems.
User-Level Interprocess Communication for Shared Memory Multiprocessors Bershad, B. N., Anderson, T. E., Lazowska, E.D., and Levy, H. M. Presented by Akbar.
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Lightweight Remote Procedure Call B. Bershad, T. Anderson, E. Lazowska and H. Levy U. Of Washington.
Fast Communication Firefly RPC Lightweight RPC  CS 614  Tuesday March 13, 2001  Jeff Hoy.
Lightweight Remote Procedure Call BRIAN N. BERSHAD THOMAS E. ANDERSON EDWARD D. LAZOWSKA HENRY M. LEVY Presented by Wen Sun.
Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,
Presented By Srinivas Sundaravaradan. MACH µ-Kernel system based on message passing Over 5000 cycles to transfer a short message Buffering IPC L3 Similar.
G Robert Grimm New York University Lightweight RPC.
CS533 Concepts of Operating Systems Class 8 Remote Procedure Call & LRPC.
User-Level Interprocess Communication for Shared Memory Multiprocessors Bershad, B. N., Anderson, T. E., Lazowska, E.D., and Levy, H. M. Presented by Chris.
SCHEDULER ACTIVATIONS Effective Kernel Support for the User-level Management of Parallelism Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska, Henry.
Extensibility, Safety and Performance in the SPIN Operating System Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
CS533 Concepts of Operating Systems Class 8 Shared Memory Implementations of Remote Procedure Call.
User Level Interprocess Communication for Shared Memory Multiprocessor by Bershad, B.N. Anderson, A.E., Lazowska, E.D., and Levy, H.M.
CS533 Concepts of Operating Systems Class 4 Remote Procedure Call.
Scheduler Activations Effective Kernel Support for the User-Level Management of Parallelism.
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, Henry M. Levy ACM Transactions Vol. 8, No. 1, February 1990,
USER LEVEL INTERPROCESS COMMUNICATION FOR SHARED MEMORY MULTIPROCESSORS Presented by Elakkiya Pandian CS 533 OPERATING SYSTEMS – SPRING 2011 Brian N. Bershad.
Extensibility, Safety and Performance in the SPIN Operating System Dave Camarillo.
1 Chapter 4 Threads Threads: Resource ownership and execution.
Inter-Process Communication  most OSs provide several abstractions for inter- process communication: message passing, shared memory, etc.  communication.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
CS533 Concepts of Operating Systems Class 4 Remote Procedure Call.
Remote Procedure Calls Taiyang Chen 10/06/2009. Overview Remote Procedure Call (RPC): procedure call across the network Lightweight Remote Procedure Call.
Optimizing RPC “Lightweight Remote Procedure Call” (1990) Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, Henry M. Levy (University of Washington)
1 Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska and Henry M. Levy Presented by: Karthika Kothapally.
CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi.
CS510 Concurrent Systems Jonathan Walpole. Lightweight Remote Procedure Call (LRPC)
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
Chapter 4 Threads, SMP, and Microkernels Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E.
Lightweight Remote Procedure Call (Bershad, et. al.) Andy Jost CS 533, Winter 2012.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Fast Multi-Threading on Shared Memory Multi-Processors Joseph Cordina B.Sc. Computer Science and Physics Year IV.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Scheduler Activations: Effective Kernel Support for the User- Level Management of Parallelism. Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska,
Scheduler Activations: Effective Kernel Support for the User-level Management of Parallelism Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska,
Lightweight Remote Procedure Call BRIAN N. BERSHAD, THOMAS E. ANDERSON, EDWARD D. LASOWSKA, AND HENRY M. LEVY UNIVERSTY OF WASHINGTON "Lightweight Remote.
Processes Introduction to Operating Systems: Module 3.
The Mach System Abraham Silberschatz, Peter Baer Galvin, Greg Gagne Presentation By: Agnimitra Roy.
Networking Implementations (part 1) CPS210 Spring 2006.
LRPC Firefly RPC, Lightweight RPC, Winsock Direct and VIA.
Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy. Presented by: Tim Fleck.
M. Accetta, R. Baron, W. Bolosky, D. Golub, R. Rashid, A. Tevanian, and M. Young MACH: A New Kernel Foundation for UNIX Development Presenter: Wei-Lwun.
Processes and Virtual Memory
The Mach System Silberschatz et al Presented By Anjana Venkat.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Efficient software-based fault isolation Robert Wahbe, Steven Lucco, Thomas Anderson & Susan Graham Presented by: Stelian Coros.
Brian Bershad, Thomas Anderson, Edward Lazowska, and Henry Levy Presented by: Byron Marohn Published: 1991.
Efficient Software-Based Fault Isolation Authors: Robert Wahbe Steven Lucco Thomas E. Anderson Susan L. Graham Presenter: Gregory Netland.
Implementing Remote Procedure Call Landon Cox February 12, 2016.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Processes Chapter 3. Processes in Distributed Systems Processes and threads –Introduction to threads –Distinction between threads and processes Threads.
The Mach System Sri Ramkrishna.
CS533 Concepts of Operating Systems
B. N. Bershad, T. E. Anderson, E. D. Lazowska and H. M
CS533 Concepts of Operating Systems Class 10
By Brian N. Bershad, Thomas E. Anderson, Edward D
Fast Communication and User Level Parallelism
Presented by Neha Agrawal
Prof. Leonardo Mostarda University of Camerino
Presented by: SHILPI AGARWAL
Thomas E. Anderson, Brian N. Bershad,
Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M
Threads CSE 2431: Introduction to Operating Systems
Presentation transcript:

Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat

Outline Introduction RPC refresher Monolithic OS vs. micro-kernel OS Use and Performance of RPC in Systems Cross-domain vs. cross-machine Problems with traditional RPC used for cross-domain RPC Lightweight RPC (LRPC) Implementation Performance Conclusion

Introduction

What is an RPC? An inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space without the programmer explicitly coding the details for this remote interaction call

Monolithic kernel & Micro-kernel OSs

Monolithic kernel OS Advantages All parts of kernel have easy access to hardware Easy communication between kernel threads due to shared address space Disadvantages Increasingly complex code as kernel grows, difficult to isolate problems and add/remove/modify code Large amount of code having direct access makes hardware more vulnerable

Micro-kernel OS Advantages Since modules are in user space, relatively easy to add/remove/modify functionality to operating system Hardware is only accessed directly by small amount of protected kernel code Completely separate modules helps with isolating problems & debugging Each module in its own “protection domain”, since can only access its own address space Disadvantages User-level modules must interact with each other over separate address spaces, difficult to achieve good performance

Use and Performance of RPC in Systems

Cross-domain RPC (local RPC) Local remote procedure call Remote since it accessing a “remote” address space, local because it is a procedure call on the same machine General RPC model used for inter-process communication (IPC) in micro-kernel systems

Comparatively, how often does a system execute cross-machine RPC vs. cross- domain RPC? *Measured over 5-hr period on work day for Taos, over 4 days for Sun workstation

Size and complexity of cross-domain RPCs Survey includes 28 RPC services defining 366 procedures w/ parameters over four-day period using SRC RPC on Taos OS

Why not just use standard RPC implementation for cross-domain calls?

Overhead in cross-domain RPC Stub overhead execution path is general, but much code in path is not needed for cross-domain Message Buffer management Allocate buffers; copies to kernel and back Access validation Kernel validates message sender on call and again on return Message transfer Enqueue/dequeue messages Scheduling Programmer sees one abstract thread crossing domains; kernel has threads fixed in their own domain signaling each other Context switch Swap virtual memory from client’s domain to server’s domain and back Dispatch Receiver thread in server domain interprets message and dispatches thread to execute the call

Lightweight RPC (LRPC)

What is LRPC? Modified implementation of RPC optimized for cross-domain calls Execution model borrowed from protected procedure call Call to server procedure made by kernel trap Kernel validates caller, creates a linkage, dispatches client’s thread directly to server domain Client provides server with argument stack along with thread Programming semantics borrowed from RPC Servers execute in private protection domain & export 1+ interfaces Client binds to server interface before starting to make calls Server authorizes client by allowing binding to occur

Implementation Details Binding Kernel allocates A-stacks (argument stacks) in both client and server domains for each procedure in the interface which are shared & read/write Procedures can share A-stacks (if of similar size) to reduce storage needs Kernel creates linkage record for each A-stack allocated to record caller’s return address (kernel accessible only) Kernel returns Binding Object containing key for accessing server’s interface & A-stack list (for each procedure) to client

Implementation Details Client calls into stub, which: Takes A-stack off of stub-managed A-stack queue & pushes client’s arguments onto it Puts address of A-stack, binding object, & procedure ID into registers Traps to the kernel Kernel then: Verifies binding object, procedure ID, A-stack & linkage Records caller’s return address and stack pointer in the linkage Updates thread’s user stack pointer to run off an Execution stack (E-stack) in the server’s domain & reloads processor’s virtual memory registers with those of server domain Does an upcall into the server’s stub to execute the procedure

Implementation Details Returning Server procedure returns through its own stub No need to verify Binding Object, procedure identifier, and A-stack (already in the linkage and not changed by server return call) A-stack contains procedure’s return values

Optimizations Separate code paths for cross-machine vs. cross domain calls, and distinction made from first instruction executed in stub Keep E-stacks allocated and associated with A-stacks, only allocate new E- stack when none unassociated available Each A-stack queue (per procedure) has its own lock, so minimum contention in multi-threaded scenario In multiprocessor systems, kernel caches domain contexts for idle processors After LRPC call is made, kernel checks for processor idling in context of server domain If found, kernel exchanges processors of calling & idling threads, & server procedure can execute without requiring context switch

A Note about A-stacks and E-stacks Modula2+ language has the convention that procedure calls use a separate argument pointer instead of requiring the arguments be pushed onto the execution stack Different threads cannot share E-stacks, but because of the convention used it is safe to share A-stacks If LRPC was implemented in a language where E-stacks have to contain arguments (such as C), the optimization of shared A-stacks would not be possible (thus arguments would need extra copies)

Performance of LRPC Ran on Firefly using LRPC & Taos RPC 100,000 cross domain calls in tight loop, averaged time LRPC/MP uses idle processor domain caching, LRPC does context switch on every call on single processor

Conclusion

Cross-domain RPC calls are significantly more common than cross- machine RPC calls Significant amount of extra overhead in standard RPC execution path when used for cross-domain calls LRPC eliminates many sources of overhead by creating a separate version of RPC that is optimized for cross-domain calls (arguably the common case of RPC) LRPC was shown to improve cross-domain RPC performance by a factor of 3 (in the Firefly/Taos system) over Taos RPC