VMM in VAX/VMS
Background
- VAX: Virtual Address Extension
- VMS: Virtual Memory System
- defacto virtual memory system for Unix as well
- Goal: provide a single environment for all VAX-based applications, whether real-time, timesharing or batch. can operate on different cpu / memory.
Address Space
Virtual address
- 32 bits (2 for region/space, 21 for page number, 9 for offset)
- 512-bytes page
- System space is shared by all processes in this system
P0: program region
- executable program
- (grows toward higher)
- P1: program control
- process-specifc data
- program image for the command interpreter
- (grows toward lower)
- Sys: system address space -- the OS
Res: reserved
When switch between user and kernel mode, the current process is in the same address space. (Do not need to flush the TLB)
Page table
- Each region (P0, P1, System) is defined by a page table
- array of 32-bit page-table entries.
- PTE contains:
- Each page table is defined by two hardware registers
- base address register
- length register
- P0, P1 page tables for each process are located in the system-space section of the address space;
- Translation of a process-space virtual address
- find process page table registers in system page table
- find physical address in process page table
- When context switch, P0, P1 base and length register change
Space layout
- system space layout
per-process space layout
Memory-management implementation
- pager: replace page
- process-local page replacement policy
- resident-set list (limited size)
- FIFO
- resident-set list (limited size)
- process-local page replacement policy
swapper: replace process
free page list & modified page list
- modified page list
- act as a cache of recently removed resident-set pages
- allows for clustering writes to the page file
- Delaying modified-page write:
Segment: a set of virtually contiguous pages with similar attributes.
demand-zero page: a page that is created for a program and initialized to zero on demand.
VM Hardware
Regions in address space are contiguous
User vs. Kernel
- User page tables exist in kernel address space
- Kernel page tables exist in physical memory space
- Kernel page table can’t be paged while User page can
Optimizations
- local page replacement
- each process has a maximum resident size of memory
- when it reaches max, it replaces from its own set of pages
- Why? -- Isolation
- page caching
- clustering
- Motivation
- small page size (512B)
- inefficent for I/O
- read and write several page at a time to reduce the number of physical disk operations.
- Motivation
Replacement
- Why use FIFO instead of LRU
- Low overhead algorithm Only when page fault, go through OS (OS know the page reference)(OS not crack each memory reference) But, it’s easy for OS to crack which page is the oldest one.
Page Caching
Victim cache is a fully associative cache, whose size is typically 4 to 16 cache lines, residing between a direct mapped L1 cache and the next level of memory. On a main cache miss, before going to the next level, the victim cache is checked.
- Evicted pages are not immediately reused
- Two lists
- A fault to one of these pages brings it back into resident set
- Big saving on dirty pages (no writes)
- also called “second chance”
- Performance evaluation found 50% of faults were to pages on lists.