Machine-Independent Virtual Memory Management
Noted by Lantian Zheng, Feb 1999
Goals for the VM manager of Mach
- Make it as portable as possible and without loss of efficiency
- Support for applications using large, possibly sparse address space
- Integration of memory management and communication
- Provide flexible memory-sharing mechanism
Strategies
- Separate the machine-independent codes from the machine-dependent codes
- External pagers (memory object manager) in user mode
- Copy-on-write mechanism
Components
- Pmap module
- Run in the kernel
- Concerned with managing the MMU (set up MMU registers and hardware page tables, and
catch all page faults)
- Depend on the MMU architecture and must be rewritten for each new machine.
- Machine-independent kernel code
- concerned with processing page faults, managing address maps, replacing pages
- External pagers
- run in the user mode
- handle the backing store, page-in and page-out
Implementation Details
- User process has a large, linear virtual address space.
- Virtual memory can be allocated and deallocated by region, which is also the
unit of memory sharing.
- Regions are mapped to memory objects by a data structure called address map, a
memory object is a repository for data.
- Copy-on-write coping is implemented by shadow objects, while read/write sharing is
implemented with a level of indirection--a sharing map.
- Comparison of different MMU architecture
- The large size of a VAX page table has made pmap more complex
- Inverted page table architecture simplified pmap, but it allows only one valid
mapping for each physical page.
- Segmentation with paging makes it possible to reasonably implement sparse addressing.
- The main issue with multiprocessor is TLB consistency, since there's no hardware support
for it.
Questions
- What do you think about the overhead caused by user-mode-pager? What's your opinion
about microkernel? Is it outdated?
- Generally, high portability and high performance are contradict to each other. What do
you think of the high performance showed by the data in Table 7-1?
- Does the existence of machine-independence codes make it more difficult to exploit the
potential of MMU?
- What is the cost of copy-on-write mechanism? Is the cost small enough to justify
copy-on-write?