small spaces are now implemented

Jonathan S. Shapiro jsshapiro@earthlink.net
Sun, 8 Feb 1998 14:09:59 -0500


I have completed a C++ implementation (i.e. no fast path yet) of
Liedtke's "small spaces," and verified that it works for at least one
difficult test case -- the space bank test.

Small spaces are transparently upgraded to large spaces if the process
exceeds the small space range with a valid address reference, or if
the process takes a general protection (GP) or stack segment (SS)
fault.

GP and SS faults occur on segment-bound-exceeding user-level
references, but unfortunately also occur on things like system traps
that hit an invalid trap entry point (as will happen for UNIX
syscalls).  The latter is hard to avoid, because the processor
provides inadequate information to differentiate them without
disassembly of the user-mode instruction, which may have been the
source of the fault.

The basic specs of a small space are as follows:

    Virtual address range:	   0-128k
    Total small spaces:		   currently 1024, up to 4096

All processes are initially loaded as small spaces, and allowed to
fault their way up.  In general, a large space will have a relatively
high stack pointer, so this upward fault occurs early in the process
lifespan, minimizing the number of PTE regenerations.

It has just occurred to me that the context load should check if the
PC or SP value exceeds the small space bounds at context load time,
and if so immediately promote to large space -- this will reduce total
faults.
    
Actually, the kernel diagnostics were kind of cool to watch.  The
ramdisk provides a sufficiently small checkpoint area that the
spacebank gets unloaded often by the checkpoint logic. You can watch
the space upgrades happen and strenuously exercise the IPC code under
such conditions.

The spacebank app and it's associated test case are unmodified, and
are entirely oblivious to the underlying space ping pongs.


shap