Hypervisor Spatial Locality Preservation for Guest Memory

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvepage loading efficiencyVSAvoidspatial locality preservation
Core Design Contradiction:
ProductivityVSReliability

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #10Preliminary action

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

Engineering Contradiction:
Improvememory management flexibilityVSAvoidspatial locality guarantee
Core Design Contradiction:
Adaptability or versatilityVSManufacturing precision

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #35Parameter changes

3Adaptability or versatility

If repeated allocations/deallocations occur in the guest OS, then memory allocation flexibility is improved, but spatial locality is lost

Engineering Contradiction:
Improvememory allocation flexibilityVSAvoidspatial locality
Core Design Contradiction:
Adaptability or versatilityVSStability of the object's composition

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #10Preliminary action

4Speed

If live migration is performed without spatial locality preservation, then migration speed is improved, but application downtime increases

Engineering Contradiction:
Improvemigration speedVSAvoidapplication downtime
Core Design Contradiction:
SpeedVSLoss of time

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.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS9454489B2Exporting guest spatial locality to hypervisors
Publication Date: 2016.09.27 VMWARE INC
  • US9454489B2 patent drawing
  • US9454489B2 patent drawing
  • US9454489B2 patent drawing

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.