Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi.

Similar presentations


Presentation on theme: "CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi."— Presentation transcript:

1 CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi

2 CS533 - Concepts of Operating Systems 2 Contents  Overview  Rationale of LPRC  Design and Implementation  Performance/Validation

3 CS533 - Concepts of Operating Systems 3 Lightweight Remote Procedure Calls (LRPC)  Problem: o Existing RPC systems incur an unnecessarily high overhead for cross-domain communication

4 CS533 - Concepts of Operating Systems 4 Sources of Overhead in RPC  Stub overhead  Message buffer overhead  Access validation  Message transfer  Scheduling  Context switch  Dispatch

5 CS533 - Concepts of Operating Systems 5 Lightweight Remote Procedure Calls (LRPC)  LRPC is a communication facility designed & optimized for cross-domain communication o Combines control transfer and communication model of capability systems with RPC’s large-grained protection model o Encourages both safety & performance o Achieves 3x performance improvement Simple Control Transfer Simple Data Transfer Simple Stubs Design for Concurrency

6 CS533 - Concepts of Operating Systems 6 Most IPC is cross-domain, not cross machine!

7 CS533 - Concepts of Operating Systems 7 Most IPC is simple!

8 CS533 - Concepts of Operating Systems 8 Design and Implementation Trap to Kernel Execute procedure and copy results Client User stub Server Kernel stub UpcallReturn (trap) A A stack Copy args

9 CS533 - Concepts of Operating Systems 9 Binding  At conceptual level, similar with RPC  At lower level, includes: 1. Server exports interface 2. Clerk registers interface and awaits import request 3. Client makes an import call via kernel 4. Clerk replies to kernel with a procedure descriptor list (PDL) o PDL contains: PD, entry address, # simultaneous calls, size of A-stack o A-stack are mapped read-write and shared by both domains 5. Kernel allocates memory 6. Kernel returns Binding Object and A-stack list

10 CS533 - Concepts of Operating Systems 10 Calling  Client o Call into client stub  Client Stub o Get an A-stack o Copy arguments into A-stack o Trap into the kernel (Binding Object, AS pointer, procedure ID)

11 CS533 - Concepts of Operating Systems 11 Calling (contd)  Kernel: o verifies binding, procedure ID, A-stack o locate the correct PD & linkage o ensures that no other thread using A-stack/linkage pair o Records caller’s return address and current stack pointer in the linkage o Pushes linkage onto top of stack of linkages kept in thread’s control block o Finds E-stack in the server’s domain o Updates thread’s user stack pointer to run off the new E-stack o Reloads processor’s Virtual Memory registers with those of the server domain o Performs upcall into the server stub

12 CS533 - Concepts of Operating Systems 12 Calling (contd)  Server Stub: o Copy immutable args from A-stack to a new region o Call server procedure, server executes o Copy return value into A-stack o Trap back to kernel  Kernel o Pop Linkage Record off the thread control block stack o Mark it “not in use”, free the server stack  Client Stub: o Reads the return value from A-stack o Return the result to client

13 CS533 - Concepts of Operating Systems 13 LRPC on Multiprocessor  LRPC on multiprocessors: o Improves throughput o Lower call latency  Context switch: o Domain Caching - Server’s context are cached in idle processors o When a client calls procedure, kernel exchanges caller’s processor with server’s processor o On return, kernel exchanges those processors back.

14 CS533 - Concepts of Operating Systems 14 Argument Copying  Traditional RPC: an argument is copied 4 times o Client stub – RPC message (client’s domain) – kernel – RPC message (server’s domain) – server stub  LPRC: an argument is copied only once o Client stub – A-stack

15 CS533 - Concepts of Operating Systems 15 Performance of LRPC Unlike RPC, no throughput limit detected Faster than RPC

16 CS533 - Concepts of Operating Systems 16 Additional Issues  Transparency o A bit in Binding Object indicates if a call is remote  A-stacks o Stub Generator determines the number and size of A- stacks o Statically or dynamically (default: Ethernet packet size)

17 CS533 - Concepts of Operating Systems 17 Additional Issues (cont.)  Domain Termination o If the terminating domain is a server, the call must return to the client domain o If it is a client, the call must not be allowed to return to its originating domain. o Steps: Revoke Binding Object to prevent making more in-calls All threads in the domain are stopped Look for any threads running on behalf of the LRPC call, restart Invalidates any active linkage records. Raise a call-failed exception, destroy threads with no valid linkage records

18 CS533 - Concepts of Operating Systems 18 References  Bershad et al, “Lightweight Remote Procedure Call”, 1989.  Birrel & Nelson, “Implementing Remote Procedure Calls”, 1984.  Coulouris et al, “Distributed System: Concepts and Design”, 2001.


Download ppt "CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi."

Similar presentations


Ads by Google