This document describes design and implementation of LDoors: Doors API in the Linux kernel. Doors are announced entry-points of fast intra-machine RPC first introduced in Solaris.
In Solaris process creates door by door_create() call. This call returns file descriptor, associated with STREAM. This file descriptor is usually then attached (through fattach()) to the file-system name-space so that other processes can open it. Any process holding door file descriptor invokes door by door_call() passing arguments to it. As result of this call code associated with door by the door_create() will be executed with given arguments in the address space of door server process (one that called door_create()). Invocation is finished by calling door_return() and control returns to the client process. Further details of Solaris' API can be found at docs.sun.com web site.
To implement Doors API Solaris kernel maintains a pool of threads sleeping in door server process address space and serves door invocations by dispatching them to threads from the pool.
This interface has several advantages over traditional RPC:
doors are located within normal file-system name space, ls, mv and rm work with them;
doors are subject to normal permission checks;
kernel can choose to implement some optimizations like use of memory re-mappings in stead of copying for argument passing or direct hand-off scheduling;
as kernel and door server process cooperate (through door_server_create()) in maintaining thread pool for serving door invocations, they can balance use of precious kernel resources required to support large number of concurrent clients.
That said, it seems reasonable to implement Doors API for the Linux. Described implementation has following goals:
be compatible with Solaris API at user-level, but not necessary at the sys-calls level;
be scalable both CPU-wise and with respect to the number of clients;
don't waste kernel resources especially threads;
only require localized changes in kernel code, preferably in a form of loadable kernel module.