The Space Bank, ‘bank’ here, is a user mode object that provides space for data and capabilities in Keykos. Keykos segregates data from capabilities; data are kept in 4K byte pages and capabilities are kept in nodes, 16 capabilities per node. For this note we will speak only of pages but the bank deals in nodes in a highly parallel manner.
We speak of buying a page from a bank but there is no money involved here. There is merely an order on the bank that causes the bank to return the only capability to a new page. At another abstraction level, of interest mainly to kernel designers, the bank accomplishes this by allocating a page-size disk frame to hold the new page. Another order on the bank takes a page capability as argument and “sells the page” back to the bank; this reverses the buy order and destroys all copies of the capability to the page. The disk page frame is thus deallocated. The page and capabilities thereto persist thru checkpoints and are expected to live for the lifetime of the machine or until sold back to the bank. The kernel does optimizations, now common in kernels, that a page can be created and destroyed with no disk operations required.
The bank has separate integer limits on pages and nodes. The limit decreases for buys and increases for sells. The bank refuses buy orders that would make a limit negative. To each bank there are four successively stronger capabilities:
There is an order on even a weak bank key to produce a sub-bank. This order takes arbitrary positive node and page limits as arguments. A page bought from a sub-bank is effectively bought from its superior bank and both limits are decremented and must remain positive. (See this pattern.) The space bank code is optimized to make many levels of sub-banks practical. There is an order on a space bank that destroys the bank; there are two varieties: