Virtual Machine Memory Management via Execution-in-Place and Delta Files

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Virtual Machines (VMs) have low memory density due to non-shared files and inefficient memory scanning processes, leading to high RAM usage and performance issues when multiple VMs run on the same host, with existing methods failing to effectively share memory and save changes upon guest halting.

Innovation Solution

A method utilizing a thin provisioning block device, such as ploop, which stores shared pages as delta files, allowing execution-in-place without an intermediate buffer cache, and manages page faults to ensure changed pages are saved by converting read-only templates to read-write deltas, thereby reducing memory usage and preserving changes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If conventional memory sharing methods are used to allow multiple VMs to share files, then memory usage is reduced, but the scanning process becomes slow and CPU intensive

Engineering Contradiction:
Improvememory usageVSAvoidscanning speed
Core Design Contradiction:
Quantity of substanceVSProductivity

Solution Approach 1:

The patent applies preliminary action by pre-marking template pages as shared before VMs are created. When a VM is instantiated, the hypervisor automatically identifies and marks the corresponding pages in the template as shared, eliminating the need for slow post-creation scanning. This preliminary marking enables immediate memory sharing upon VM startup.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If pages are marked copy-on-write to prevent data corruption, then reliability is improved, but changes cannot be saved onto the disk

Engineering Contradiction:
Improvedata corruption preventionVSAvoiddata persistence
Core Design Contradiction:
ReliabilityVSLoss of substance

Solution Approach 1:

The patent segments the storage structure into template pages and delta pages. Template pages remain read-only and marked as shared, ensuring data protection. When a VM writes to a page, a corresponding delta page is created in the VM's private storage area. This segmentation allows template pages to maintain reliability while delta pages capture and preserve all changes separately.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent uses copying to create delta pages as private copies when writes occur. Instead of modifying the original template pages directly (which would risk corruption), the system copies the necessary pages to delta pages in the VM's private storage, allowing changes to be saved and persisted without affecting the integrity of the shared template.

Inventive Principle:
Principle #26Copying

3Reliability

If each VM uses its own set of files, then VM isolation and reliability are improved, but memory density decreases

Engineering Contradiction:
ImproveVM isolationVSAvoidmemory density
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent merges multiple VMs' file storage into a single shared template file on the host system. Multiple VMs can simultaneously access and execute code from the same template pages, dramatically improving memory density. VM isolation is maintained through delta pages that store private modifications, ensuring each VM has its own isolated storage space while sharing common code.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent makes the template file universal by allowing it to be shared across multiple VMs simultaneously. A single template file serves multiple VMs as their common code repository, eliminating the need for separate file copies for each VM. This multi-functional use of the template file achieves high memory density while maintaining VM isolation through the delta page mechanism.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS10037334B1Memory management and sharing host OS files for Virtual Machines using execution-in-place
Publication Date: 2018.07.31 VIRTUOZZO INT GMBH
  • US10037334B1 patent drawing
  • US10037334B1 patent drawing
  • US10037334B1 patent drawing

AI summary

A system for memory management for Virtual Machines (VMs), including a host computer system running a host operating system (OS); at least two Virtual Machines (VMs) running on the host computer system, wherein each of the VMs has a Guest OS supporting a guest file system with execution-in-place that allows code execution without an intermediate buffer cache; a hypervisor configured to control the VMs; and a thin provisioning block device configured to store shared pages and formed of at least one delta file. The hypervisor is configured to receive a page fault, and to read the shared pages from the thin provisioning block device. The Guest OS executes the file that is stored on the thin provisioning block device.