Expand description
Demand Paging and Copy-on-Write (COW) Manager
Provides infrastructure for lazy page allocation and COW fork support.
§Demand Paging
Pages can be registered as “lazy” mappings via register_lazy. When
a page fault hits a lazy-mapped address, the manager allocates a physical
frame and returns it (along with the appropriate flags) so the caller can
install the mapping in the page table.
§Copy-on-Write
CowTable tracks shared physical frames with reference counts. When a
COW page is written, the fault handler calls
DemandPagingManager::handle_cow_fault to allocate a private copy and
decrement the shared reference count.
Structs§
- CowEntry
- A single COW-shared physical frame.
- CowTable
- Table of COW-shared frames keyed by virtual page address.
- Demand
Paging Manager - Manages lazy mappings and COW state.
- Lazy
Mapping - A region of virtual address space registered for demand paging.
Enums§
- Backing
Type - How a lazy page is backed when finally faulted in.
Functions§
- handle_
page_ fault - Try to resolve a page fault via demand paging.
- init
- Initialize the global demand paging manager.
- register_
lazy - Register a lazy mapping via the global manager.
- with_
manager_ mut - Access the global demand paging manager (mutable).