Hypervisor Spatial Locality Preservation for Guest Memory
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Virtualization software struggles to maintain spatial locality of guest physical pages across different memory allocations and migrations, leading to inefficiencies in page loading and increased application downtime during live migrations, host-level swapping, and guest suspends/resumes.
Innovation Solution
The technique involves identifying guest virtual page faults, translating nearby guest virtual pages into their corresponding physical pages, and pre-loading these pages into memory to preserve spatial locality, thereby reducing page faults and improving performance during migrations, swapping, and suspend/resume operations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If the guest operating system maintains spatial locality at the physical layer, then page loading efficiency is improved, but this locality is eventually lost after repeated allocations/deallocations and internal fragmentation
Solution Approach 1:
The hypervisor acts as an intermediary between the guest OS and physical memory. It intercepts page fault requests, translates guest virtual page numbers to physical page numbers using its own page tables, and performs pre-fetching of spatially local pages. This intermediary mechanism preserves spatial locality information that the guest OS loses through its own allocation/deallocation operations.
Solution Approach 2:
The hypervisor performs preliminary action by pre-fetching guest physical pages into host memory before they are actually needed. When a page fault occurs, the hypervisor identifies nearby virtual pages in the guest's address space and loads their corresponding physical pages into memory in advance, based on spatial locality principles. This prevents subsequent page faults and improves page loading efficiency.
2Adaptability or versatility
If the guest OS controls GVPN to GPPN translations, then memory management flexibility is improved, but spatial locality in GPPN space cannot be guaranteed
Solution Approach 1:
The hypervisor serves as an intermediary that maintains the guest OS's control over its own memory management while adding a layer of spatial locality preservation. The hypervisor's page tables establish a consistent mapping between guest virtual pages and physical pages, ensuring that spatially local virtual pages map to spatially local physical pages regardless of the guest OS's allocation decisions.
Solution Approach 2:
The system changes the parameter of address space mapping by introducing a second-level page table structure. The guest OS continues to manage GVPN to GPPN mappings freely, but the hypervisor adds a GPPN to physical page number mapping layer that enforces spatial locality. This parameter change allows both flexibility and locality guarantee to coexist.
3Adaptability or versatility
If repeated allocations/deallocations occur in the guest OS, then memory allocation flexibility is improved, but spatial locality is lost
Solution Approach 1:
The hypervisor's page fault handler acts as an intermediary that observes and exploits spatial locality patterns. When a guest page fault occurs, the hypervisor examines the faulting virtual page number and automatically loads nearby virtual pages' physical pages into memory, preserving spatial locality despite the guest OS's flexible allocation/deallocation operations.
Solution Approach 2:
The hypervisor performs preliminary loading of spatially local pages before the guest OS completes its allocation/deallocation operations. By pre-fetching pages based on spatial locality principles, the system maintains stable spatial locality composition even as the guest OS dynamically reallocates memory.
4Speed
If live migration is performed without spatial locality preservation, then migration speed is improved, but application downtime increases
Solution Approach 1:
During live migration, the hypervisor performs preliminary action by pre-fetching and loading spatially local guest physical pages into the destination host's memory before the migration completes. This reduces the number of page faults the application experiences during and after migration, minimizing application downtime while maintaining high migration speed through efficient pre-fetching operations.
Data Source
AI summary
When a request is made to retrieve a guest physical page from memory and a page fault occurs, a guest virtual page address that corresponds to the guest physical page is identified along with addresses for guest virtual pages that are near the guest virtual page in the virtual address space. Each identified guest virtual page address is translated into a corresponding guest physical page address and the corresponding guest physical pages are loaded into memory.


