Memory Management

Mon Apr 28 16:12:25 1997
Stefan Savage & Yasushi Saito


Overview

This core SPIN memory management services are designed to provide access to both physical memory resources and the MMU. These services are necessary (and ideally sufficient) to develop general virtual memory systems as well as specialized memory management implementations.

It is equally important that these services guard against any misuse or malicious action. Particularly, it must be impossible to modify kernel code or data structure in any way which might compromise the type-safety properties required by the kernel. Secondarily, the kernel must guard against resource consumption attacks (e.g. allocating undue quantities of physical memory). Spincore addresses the first problem by encapsulating each page frame in an opaque Modula-3 object(PhysAddr.T), and allowing accesses to frame contents only through procedure calls. The second problem is addressed by implementing a involuntary frame purging through the use of the dispatcher mechanism.

Basic abstractions

SPIN's basic memory abstractions are physical frames (PhysAddr), and translations to virtual addresses (Translation). In general, access to memory consists of two steps: allocating some physical frame and mapping it to a virtual address range in a particular translation context.

Physical Addresses

The PhysAddr.i3 interface defines all public operations on physical memory. Also, it defines the opaque data type PhysAddr.T which represents a contiguous block of physical memory. There are two kinds of PhysAddr.T objects. One is an ordinally page frame of the MMU page size. Other is an object that represents arbitrary physical address range. The latter is used to access I/O space, and it can be allocated only through PhysAddrPrivate.AllocateIOSpace, a privileged procedure.

Translations

A translation represents a context in which virtual address are translated (eg. an address space or protection domain). It is currently implemented in terms of pmap operations. The Translation.i3 interface defines all operations on translations. It also defines the opaque data type Translation.T which represents a particular translation context.

Getting and setting VM parameters

The vm shell command is provided to tweak the vm parameters.
vm params
This command returns the current parameters. I don't know what the request threshold is.

If the # of free pages fall below reclaim threshold, an active page is picked up and reclaimed.

If the # of free pages fall below repossess threshold, an reclaimed page is picked up and made free.

vm setparams
This command takes three integer parameters. Each number specifies the request, reclaim, repossess threshold repectively.
vm stat
This command returns the # of pages in each state.


{yasushi,savage}@cs.washington.edu