Date: January 19, 2025

Topic: RPC and Client-Server Systems

Recall

Performing an RPC is a lot more costly due to overheads like context switches and trapping, which requires the kernels involvement.

It also runs at runtime instead of compile time like a normal procedure call.

Notes

RPC and Client-Server Systems

RPC vs Simple Procedure Call

image.png

Normal Procedure Call

Remote Procedure Call

Lightweight RPC: Kernel Copies Quiz

In an RPC (client call - server execution - return results to the client), how many times does the kernel copy "stuff" from user address spaces into the kernel and vice-versa?


Making a complete RPC call requires 8 copying steps and interactions between the user level and kernel level, resulting in a lot of overheads compared to a normal procedure call.

Copying Overhead

image.png





<aside> 📌 SUMMARY: By using LRPC, we can eliminate some overheads in the original RPC implementation. This is done with a setup phase which requires user-kernel crossings to set up the PD, A-stack and BO. After this is done, future communications are validated from Client using the BO into the Kernel, but data communication can be just between the Client and Server. This reduces copying from 4 times to 2 times from Client to Server. In SMP, LRPC can be further extended by dedicating certain CPUs to just be servers. This allow the caches to be warm and thus reduces the impact from loss of locality.

</aside>


Date: February 10, 2025

Topic: Scheduling