Mach Virtual Memory

Goals

  • Portability
    • Many architectures
    • Multiprocessor
  • S/W changing
    • Multi-threading
    • Shared-library
    • Memory mapped files
      • Issue: H/W knows to a I/O bus (e.g., Pipe, Instruct) rather than Mem bus (Inst)

Copy-on-write

When a fork is invoked, the newly created child task address map is cretaed based on the parent's inheritance values. By default, all inheritance values for an address space are set to copy. Thus the child's address space is by default, a copy-on-write copy of the parent's.

Address Map

A doubly linked list of map entries, each of which describes a mapping from a contiguous range of virtual addresses onto a contiguous area of a memory object.

Each address map entry carries with it information about the inheritance and protection attributes of the region of memory it defines.

This can compress the sparse address space, with a lot of holes inside it.

      +------+    +------+    +------+    +------+    +------+
      |      +----+      +----+      +----+      +----+      |
      +--+---+    +------+    +------+    +---^--+    +------+
         |                                    |
         v                                    |
Contiguous space in VAS                       |
Same Protection                           +---+---+
Same backend store                        |       |
                                          +-------+

                                          File system, Memory object

Memory Object

In backend store, portional to the address map for a given portion of an address space.

Send MSG to memory object, paging request.

Remote paging through N/W.

Shadow Object

Memory objects for the modified pages.

pmap

For portability, pmap module is to manipulate H/Wdependent part. It acts as a port from H/W independent part to translate into H/W dependent part.

Therefore, the address map does not know about the page table and TLB, and the page table and TLB don't care about the upper-level data structures.