The standard segment keeper FSC {(p2,fsc)} creates new (fresh) pages and installs them at the virtual address where they are needed.
See (p3,vcsklogic) for the program logic of a real segment keeper.
It may be required to completely hide the actions of the reader from the writer.
See (p2,vcsk) and (p2,fs) about available segment keepers that implement some of these ideas.
Constant and Variable segments
If neither will change, memory keys to either are interchangeable and the copy operation consists of copying the key.
If X is constant after the copy but Y changes, then nodes and pages of Y that define portions of Y that are different than X are created for Y but other pages and nodes are shared. It is important that X need not be modified to perform the copy. This is the case that has been considered in current designs.
If Y is constant but X will (continue to) change {typical of a checkpoint} then it seems that the representation of X must be changed in order to perform the copy.
This has the curious effect of deferring and avoiding, in part, the cost of Y. There is a danger of confusion here: X's space bank may not have been selected to be able to support the real cost of Y. There is no easy way of segregating the cost of maintaining X and Y.
To do this we create a node N and distribute red segment keys to N to wherever we wish there to be access to the segment. N is formatted for a large lss and for only one initial slot which holds the segment key to the real segment. The checkpoints taker keeps a node key to N. When it is time to take a checkpoint, a call is made on the segment keeper to make the current segment read-only and provide a new read-write segment that is like the old segment.
The key to the new segment is placed in the first slot of N and we are done.
If MK is a memory key and VIRTUAL_COPY is from the public directory then VIRTUAL_COPY(0,MK==>c;VC) provides a virtual copy of MK. The pages of VC will initially be the pages of MK but with read-only access. A real copy of a page will be made by VC's segment keeper just before a store is allowed into VC. If MK is not changing the effect will be as if a real copy had been made. References to VC at addresses not defined in VIRTUAL_COPY will be initialized to zero without changing VIRTUAL_COPY.
The three sections under this paragraph each describe a strategy for implementing virtual copies. I think we will do (p3,vcpyfsc) first.
Modify the logic of the segment keeper (p2,fs) to make it obey the virtual protocol (p2,vcsk). This lacks the generality of facades but avoids any extra memory tree depth.
Do the above and in addition replace the old create fresh segment operation {(p2,fsc)} by making virtual copies of a real, shared, all-zero segment of size 2**48 bytes. This has the advantage of removing one of the two kinds of segments kept by the segment keeper. A disadvantage is that the top node of each segment has one less initial slot and a fault for a new page goes through an intermediate stage of mapping in this ubiquitous zero page before it gets down to the business of giving you the page that is really required. This scheme wins big when the first references to a new page are read references that precede the first write references by a long time. I can't think of many such situations.
Each of these operators operates on a given page or leaves it alone.
Some segments may have these functions built in, achieving greater efficiency.
Write mask: This operator yields a new memory key via which selected page addresses cannot be stored into.
New Page Upon Store: A new page is added at a p-slot when a store is first done there.
See (segment-indirect) and (p3,segkeeparmstr) for other memory tree programming notes.