Virtual Machine Memory Snapshot Management via Page Table Copying

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The existing virtual machine memory snapshot solutions are slow due to the need to suspend the virtual machine and write memory data to a disk, affecting their usability in real-world scenarios.

Innovation Solution

A method and apparatus for managing memory snapshots by suspending a virtual machine, copying its two-level page table to create a snapshot page table with read-only identifiers, increasing reference counts of memory pages, and restoring the virtual machine, allowing snapshots to be created and managed without writing to disk, thus improving speed.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If memory data is written to disk to create a snapshot, then the snapshot is persistent and reliable, but the operation becomes very slow

Engineering Contradiction:
Improvesnapshot persistenceVSAvoidsnapshot creation speed
Core Design Contradiction:
ReliabilityVSSpeed

Solution Approach 1:

The patent creates a copy of the virtual machine's page table structure in memory to represent the snapshot state, rather than writing actual memory data to disk. This page table copy points to the same memory pages as the original VM, creating a reference-based snapshot that is both fast to create and reliable for restoration purposes.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent introduces a page table structure as an intermediary layer between the virtual machine memory and the snapshot representation. This page table acts as a mediator that can be quickly copied and modified to create snapshots without directly copying or writing the underlying memory data, thus improving speed while maintaining reliability through the page table's ability to restore the original state.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Manufacturing precision

If the virtual machine is suspended to create a snapshot, then the snapshot captures the exact state, but the suspension causes service interruption

Engineering Contradiction:
Improvesnapshot state accuracyVSAvoidservice interruption time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The patent performs preliminary actions by setting up the page table structure and establishing the snapshot reference state before the VM needs to be restored. The page table is prepared with the correct state information in advance, so when restoration is needed, the VM can quickly resume without lengthy suspension periods, while still capturing the exact state through the pre-prepared page table.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

Instead of suspending the VM to copy memory contents, the patent copies the page table structure which indirectly represents the memory state. This copying approach captures the exact state information needed while requiring minimal VM suspension time, as the page table is a smaller and faster-to-copy structure compared to full memory contents.

Inventive Principle:
Principle #26Copying

3Manufacturing precision

If all memory pages are copied to create a snapshot, then the snapshot is complete and accurate, but the memory consumption increases significantly

Engineering Contradiction:
Improvesnapshot completenessVSAvoidmemory consumption
Core Design Contradiction:
Manufacturing precisionVSQuantity of substance

Solution Approach 1:

The patent copies only the page table structure rather than all memory pages to create a snapshot representation. This selective copying approach maintains snapshot completeness by preserving the page table's ability to map and restore memory state, while dramatically reducing memory consumption by avoiding duplication of the actual memory page contents.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent uses a nested structure where the snapshot is represented by a page table that contains references to existing memory pages rather than containing the page data directly. This nested reference structure achieves complete snapshot representation while minimizing memory usage, as the snapshot metadata (page table) is small compared to the actual memory contents it references.

Inventive Principle:
Principle #7Nested doll (Nesting)

Data Source

PatentUS20240394092A1Memory snapshot management method and apparatus, and device and medium
Publication Date: 2024.11.28 INSPUR SUZHOU INTELLIGENT TECH CO LTD
  • US20240394092A1 patent drawing
  • US20240394092A1 patent drawing
  • US20240394092A1 patent drawing

AI summary

Provided in the present disclosure are a memory and apparatus for managing a memory snapshot, a device, and a medium. The method includes: when a memory snapshot generation command is acquired, a virtual machine is suspended; a two-level page table of the virtual machine is copied to obtain a first snapshot page table, and a read-only identifier is set for each of page table entries of the two-level page table; and memory pages corresponding to page table entries of the first snapshot page table are acquired by means of the page table entries of the first snapshot page table, a reference count of each of the memory pages is increased, and the virtual machine is restored from a suspended state to a running state.