Reaves.dev

v0.1.0

built using

Phoenix v1.7.12

Lightweight RPC

Stephen M. Reaves

::

2024-02-07

Notes about Lecture 4d for CS-6210

Summary

RPC vs Simple Procedure Call

Simple procedure call

thread2thread1thread2thread1procedure callprocedure call return

All at compile time

RPC

Gccssc->scalls->creturn
Gcckernelkernelc->kernelcall trapkernel->ccopy result to bufferkernel->kernelvalidatesskernel->scopy args to buffers->kernelreturn traps->sexecute
serverkernelclientserverkernelclientcall trapvalidatecopy args to bufferexecutereturn trapcopy result to buffer

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

Once RPC is setup, a Procedure Descriptor is setup and points to entry point in server address space

Actual Calls

A-Stack is used to store arguments (and returns)

Client executes in the address space of the server

lrpc calls

Gcluster_originaloriginalcluster_kernel                      kernelcluster_nownowcsclient stackrpcrpc msgcs->rpcclient stubkbkernel bufferrpc->kbsdserver domainkb->sdssserver stacksd->ssserver stubcsnclient stackasa stack (shared)csn->asclient stubssnserver stackas->ssnserver stub

two copies

Completely in userspace

3 explicit costs:

RPC on SMP

Exploit multiple processors

Allows multiple clients point to one server

rpc on smp