Lightweight RPC
Summary
RPC vs Simple Procedure Call
Simple procedure call
All at compile time
RPC
All at runtime
Kernel copies data from user address space to and from kernel buffers 4 times
Copying overhead is serious concern
Making RPC Cheap
If you want to use RPC as a replacement for simple procedure calls on the same machine, you need to reduce overhead
setup/binding only happens once
- It’s ok to make this more expensive if we need to
Once RPC is setup, a Procedure Descriptor is setup and points to entry point in server address space
- Also includes argument size stack, and metadata like # concurrent of calls allowed
Actual Calls
A-Stack is used to store arguments (and returns)
Client executes in the address space of the server
- Special stack (E-stack)
two copies
- Marshal (into astack)
- Unmarshal (out of astack)
Completely in userspace
3 explicit costs:
- call trap
- context switch
- Still has implicit cost of loss of locality
- return trap
RPC on SMP
Exploit multiple processors
- pre-load server domains
- keep caches warm
Allows multiple clients point to one server
- allows cache sharing