UP

Matrices

This construct is currently out of favor. It may not be implemented.

A matrix is a segment with a segment keeper. At one time there are a set of allocated disjoint portions in a matrix. A portion is a consecutive range of pages. The segment keeper will, upon request, allocate or deallocate a portion. When a matrix is created there are no allocated portions and no valid addresses in the segment. A memory key may be passed to the matrix to be installed at an allocated portion in the matrix segment. {These portions are designated by the relative address of the beginning of the portion.} A matrix has an inherent size. A matrix key is a segment key to the matrix segment. A matrix remembers what portions in the segment have been allocated and the sizes of those allocated portions.

If M is a matrix key then M(?,((5,page count));==>c,((5,location));) allocates a contiguous portion of the segment if possible. c will be 0 if it is possible and 1 otherwise. 'location' will be the relative location within the segment (in page frames) of the allocated portion. M(?,((5,portion));==>c;) deallocates a portion; "portion" must be the beginning of a previously allocated portion. M(?,((5,portion));MK==>c;) installs the memory key MK at the indicated portion of the matrix; c will be 0 if this is possible and 1 if "portion" does not indicate an allocated portion. M(kt;==>c,((5,size));) returns the inherent size of M in "size" and LOOSE END in c.

MMM(0;MK,SB==>c;NS) takes a memory key MK and a space bank SB and returns a new segmode key NS to a facade.

A facade consists of an array of 2**48/4096 p-slots {each corresponding to a page address} and a memory key to another segment.

A p-slot is either (_void) or (_present).

A present p-slot contains a page; a void p-slot does not.

A reference to a void p-slot of a facade is a reference to the corresponding address of the other segment {defined by the memory key in the facade}.

A reference to a present p-slot is a reference to the page of that p-slot.

The (_write state) of a p-slot is either RW or RO.

The following operations are possible on p-slots by the holder of a facade key:

COPY: If the p-slot is void, make it present and copy the current contents of the corresponding other page into it.

DEFERRED-COPY: Sometime between now and when I {the segment key holder} store into this page, COPY it.

GUARD: Make this p-slot RO.

An alternative design that is more general: a p-slot is in one of the following seven states:

Both reads and writes are trapped.

Writes are trapped. Reads are passed to the background segment. If there is a page at that address, you get the data. If there is no page at that address:

You trap; or

You are given a private zero page.

Reads and writes are passed to the background segment. If you read and there is a page there, you get the data. If you write and there is a read/write page there, you write on it. If you write and there is no read/write page at that address:

You trap. If you read and there is no page there:

You trap; or

You are given a private zero page.

You are given a private read/write page which is initially a copy of the background page. If you read and there is no page there:

You trap; or

You are given a private zero page.

Spage

As a special concession to those who need to address very large collections of data quickly and who cannot afford to keep the bottom indexes in core, some Gnosis kernel implementations may provide (_spage keys.) This key has the appearance to all but the kernel and the space bank of being a segment key to a node of 16 page keys. These pages are allocated on the disk contiguously.

A segment with change notification consists of a memory key and an entry to call upon store reference.

Kernel Dump Management.

Background

When the kernel crashes, real storage is copied onto disk pages whose addresses are known by a primitive mechanism. A Page Range key is available providing access to those pages. CDUMP {(cdump)} uses this key to copy the sick kernel image into a normal Gnosis segment. CDUMP then makes the key to that segment available through the directory "DUMP.".

We propose a new style segment {DSEG} customized to conserve the storage required for permanent kernel dumps. A DSEG holds a space bank key and the page range key the kernel dump range. A DSEG has three modes: save, show and dead.

In the show mode a read reference to an invalid page of the DSEG will be satisfied by installing a read only key to the page from the kernel dump range.

In the save mode such a reference will result in installing a new page with data copied from the corresponding page in the kernel dump range.

In the dead mode such a reference will result in a fault to the referencing domain indicating that the data is unavailable.

Calls on a DSEG:

Delete

Switch between save and show modes.

Indicate saved page count.

Other DSEG Events

Upon restarts the DSEG will delete page keys to the kernel dump range and go into dead mode if the range has been overwritten with a new dump.

New DSEG's are initially in the save mode and already hold the dump range key.

Usage

CDUMP would presumably create a new DSEG upon detecting a kernel crash. The DSEG would be initially in the save mode and CDUMP would merely reference the pages of the DSEG that are deemed universally interesting. Such pages would be available for the life of the DSEG.

If CDUMP needs to make room it might decide to delete the large DSEG's before the small ones.