Hypervisor Memory Allocation for Contiguous Physical Blocks

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Embedded devices, such as cameras and hardware video decoders, require large contiguous physical memory blocks for operation, which is often fragmented and difficult to allocate efficiently due to memory synchronization challenges, leading to inefficiencies and potential allocation failures, especially in systems with multiple kernel subsystems or virtual machines.

Innovation Solution

A hypervisor manages memory allocation by marking a region as migratable, receiving allocation requests, identifying contiguous frames, disabling mappings, and migrating occupied frames to allocate contiguous physical memory efficiently, thereby reducing the burden on guest operating systems and ensuring fast and stable memory allocation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If CMA migrates all occupied memory pages in a region to allocate contiguous physical memory, then contiguous memory allocation is achieved, but allocation time becomes inefficient and unstable due to complex page synchronization requirements

Engineering Contradiction:
Improvecontiguous memory allocation successVSAvoidallocation time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent segments the memory management task by introducing a hypervisor layer that separates the synchronization complexity from the guest OS. The hypervisor manages page synchronization independently while guest OSes can allocate memory without being burdened by synchronization overhead, thus resolving the contradiction between allocation reliability and time efficiency.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The hypervisor acts as an intermediary between multiple guest OSes and the physical memory management. It handles the complex page synchronization and state tracking centrally, allowing guest OSes to perform simple allocation requests without directly managing synchronization, thereby reducing allocation time while maintaining reliability.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If multiple kernel subsystems or virtual machines run concurrently and require page synchronization during memory migration, then memory allocation can be performed, but the synchronization mechanism becomes complex and reduces allocation efficiency

Engineering Contradiction:
Improveconcurrent subsystem supportVSAvoidsynchronization mechanism complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The hypervisor serves as a centralized intermediary that manages page synchronization for all guest OSes and kernel subsystems. Instead of each subsystem implementing its own synchronization logic, the hypervisor provides a unified synchronization mechanism that reduces overall system complexity while maintaining support for concurrent operations.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system enables self-service by allowing guest OSes to request memory allocation without directly participating in synchronization protocols. The hypervisor automatically handles synchronization and state tracking, enabling guest OSes to focus on their primary functions while the hypervisor manages the complex coordination requirements.

Inventive Principle:
Principle #25Self-service

3Measurement precision

If CMA maintains and keeps track of page state during page migration, then memory allocation accuracy is improved, but allocation performance deteriorates due to the overhead of state management

Engineering Contradiction:
Improvepage state tracking accuracyVSAvoidallocation throughput
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The hypervisor acts as an intermediary that centralizes page state tracking and management. Guest OSes delegate state tracking responsibilities to the hypervisor, which maintains accurate page state information while handling multiple allocation requests in parallel, thus preserving accuracy while improving overall throughput.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs preliminary actions by pre-establishing page state tracking infrastructure at the hypervisor level before allocation requests arrive. This allows the hypervisor to efficiently manage state information without adding overhead to individual allocation operations, improving productivity while maintaining precision.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10019288B2Fast and stable mechanism for allocating contiguous memory
Publication Date: 2018.07.10 MEDIATEK INC
  • US10019288B2 patent drawing
  • US10019288B2 patent drawing
  • US10019288B2 patent drawing

AI summary

A hypervisor hosted by a computing system performs a method to allocate a contiguous physical memory space to a device. A given region of physical memory is marked as migratable. From an operating system (OS) kernel, the hypervisor receives a request for memory allocation to the device, the request indicating a first set of available virtualized pages in a virtualized memory. In response to the request, the hypervisor identifies a set of contiguous frames in the given region to be allocated to the device. The set of contiguous frames are mapped to a second set of virtualized pages. The hypervisor disables the mapping for the first set of available virtualized pages and the second set of virtualized pages. Then one or more occupied frames in the set of contiguous frames are migrated out of the given region to allow for allocation of the set of contiguous frames to the device.