VMBacking.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Levin on September 20, 1983 12:03 pm
Russ Atkinson (RRA) January 30, 1985 9:51:35 pm PST
Doug Wyatt, February 27, 1985 8:59:08 am PST
DIRECTORY
Disk USING [Channel, Label, PageNumber],
PrincOps USING [PageValue];
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 potpourri 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};
StateFromPageValue: SAFE PROC [map: PrincOps.PageValue] 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 when 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.