Download - Lightweight Remote Procedure Call
![Page 1: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/1.jpg)
Lightweight Remote Procedure Call
BRIAN N. BERSHAD
THOMAS E. ANDERSON
EDWARD D. LAZOWSKA
HENRY M. LEVY
Presented by Wen Sun
![Page 2: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/2.jpg)
Overview
What is LRPC?
Why LRPC?
Design and Implementation of LRPC
The performance
![Page 3: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/3.jpg)
What is RPC?
Cross-Machine
RPC
Cross-Domain
![Page 4: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/4.jpg)
What is LRPC?
LRPC is a communication facility designed
& optimized for cross-domain communication in
the same machine.
![Page 5: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/5.jpg)
Overview
What is LRPC?
Why LRPC?
Design and Implementation of LRPC
The performance
![Page 6: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/6.jpg)
Why LRPC?
“In existing RPC systems, cross-domain calls
are implemented in terms of the facilities
required by cross-machine ones”
![Page 7: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/7.jpg)
Cross-domain dominates !
![Page 8: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/8.jpg)
Cross-domain is simple !
Most frequent case: less than 200 bytes
![Page 9: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/9.jpg)
Cross-Domain RPC Performs bad !
![Page 10: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/10.jpg)
Causes of Overhead in RPC Stub overhead the caller and receiver are on the same kind of architecture,
no need to marshal parameters and results into an intermediate, architecture independent representation
Simple stubs (simple model of control and data transfer)
Message buffer overhead (four copy operation) both are in the same physical memory space
LRPC only has one time copy from the client stub to A-stack both are in the same physical memory space
Message transfer No message transfer in LRPC ! A-stack ! Dispatch
![Page 11: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/11.jpg)
Causes of Overhead in RPC
Access validation (validate send and return)
LRPC doesn’t validate the return Scheduling
Context switch Avoid context switch on multi-CPU by
using caching domain on idle processor
![Page 12: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/12.jpg)
Overview
What is LRPC?
Why LRPC?
Design and Implementation of LRPC
The performance
![Page 13: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/13.jpg)
Design and Implementation
Trap to Kernel
Execute procedureand copy results
Client
User stub
Server
Kernel
stub
Upcall Return (trap)
A A stack
Copy args
Borrowed from Rizal Arryadi’s powerpoint (winter 2005)
![Page 14: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/14.jpg)
Binding
Server
client kernel
Clerkinterface
Server name +interface
Import call
noti
fyPD
L
Biding project (key) + A-stack list
Linkage record + A-stack
![Page 15: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/15.jpg)
CallingClient
Client Stub
Kernel
Server Stub
Call Into
(1)Get an A-stack(2)Copy arguments into A-stack
(1)verifies binding, procedure ID, A-stack(2)locate the correct PD & linkage(3)ensures that no other thread using A-stack/linkage pair(4)Records caller’s return address and current stack pointer in the linkage(5)Pushes linkage onto top of stack of linkages kept in thread’s control block(6)Finds E-stack in the server’s domain(7)Updates thread’s user stack pointer to run off the new E-stack(8)Reloads processor’s Virtual Memory registers with those of the server domain
(1)Copy immutable args from A-stack to a new region(2)Call server procedure, server executes(3)Copy return value into A-stack
Trap (Binding Object, AS pointer, procedure ID)
Upcall into Trap back
Return
result
![Page 16: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/16.jpg)
Overview
What is LRPC?
Why LRPC?
Design and Implementation of LRPC
The performance
![Page 17: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/17.jpg)
The performance (I) Roughly three times faster than SRC RPC
![Page 18: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/18.jpg)
The performance (II)
21 = 18 ( client stub) + 3 (server stub)
27 (binding validation + linkage management)
![Page 19: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/19.jpg)
The performance (III)
lock contention !
![Page 20: Lightweight Remote Procedure Call](https://reader036.vdocuments.us/reader036/viewer/2022062408/568135ca550346895d9d2c5b/html5/thumbnails/20.jpg)
Overview
What is LRPC?
Why LRPC?
Design and Implementation of LRPC
The performance