VMBacking.mesa
last edited by Levin on September 20, 1983 12:03 pm
DIRECTORY
Disk USING [Channel, PageNumber, Label],
PrincOps USING [InterimPageState];
VMBacking: DEFINITIONS =
BEGIN
The following defines the association between virtual memory and backing storage.
RunTablePageNumber: TYPE = --File.PageNumber-- INT;
FilePageCount: TYPE = --File.PageCount-- INT;
RunTable: TYPE = REF RunTableObject;
RunTableIndex: TYPE = CARDINAL;
RunTableObject: TYPE = RECORD [
nDataPages: FilePageCount,
nRuns: CARDINAL,
runs: SEQUENCE length: RunTableIndex OF Run];
Run: TYPE = RECORD [
filePage: RunTablePageNumber, diskPage: Disk.PageNumber, channel: Disk.Channel];
AttachBackingStorage: PROC [
label: Disk.Label, firstDataPage: RunTablePageNumber, runTable: RunTable];
The label parameter references a disk label for the file page corresponding to page "firstDataPage". "firstDataPage" is the page described in "runTable" that will be used to map virtual memory page 0. It is assumed that "runTable" is ordered on the "filePage" field of its constituent Runs and that there exist Runs x and y such that x.filePage <= firstDataPage < firstDataPage + runTable.nDataPages <= y.filePage. This implies that, in order to map a file with n extents in its entirety, n+1 Runs must appear in "runTable".
The following pot-pourri of definitions is really a set of private agreements between the virtual memory and file systems. These are used to support checkpoint/rollback.
BriefPageState: TYPE = {free, killed, active};
StateFromMapEntry: SAFE PROC [map: PrincOps.InterimPageState] RETURNS [BriefPageState];
This procedure interprets a raw memory map entry and assumes that it meets the representation requirements of VMInternal. The specification of this procedure is subject to change if the representation of the VMMap changes.
RecoverRealMemory: PROC;
This procedure ensures that all real memory appears in the virtual memory map, in preparation for an Inload. It does so in a very crude way; in particular, it may violate the memory abstraction for any virtual page that is not in real memory at the time. Therefore, the client must guarantee that all relevant code and data are pinned before calling this procedure.
END.