Virtual Memory Region Mapping with Flexible Huge-Page Allocation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional page management technologies result in excessive page fault processing and reduced page table cache hit rates due to small page granularity, while huge-page management is highly coupled to hardware, limiting granularity and causing memory overheads and compatibility issues.
Innovation Solution
A memory management method that allocates virtual memory regions based on different backend types, determining physical page types as common or huge pages, and establishing mapping relationships to optimize memory usage and reduce overheads.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If conventional page management technology is used, then memory management can be performed at small page granularity, but excessive page fault processing occurs and page table cache hit rate decreases
Solution Approach 1:
The patent implements dynamic page size selection where the system automatically chooses between conventional pages and huge pages based on workload characteristics and access patterns. The memory management unit dynamically adjusts page granularity without requiring hardware changes, allowing the system to adapt to different access scenarios and optimize performance accordingly.
Solution Approach 2:
The system changes the page size parameter dynamically based on access patterns and workload requirements. By adjusting the page granularity parameter from fixed small pages to variable sizes including huge pages, the system resolves the contradiction between fine-grained control and performance efficiency.
2Productivity
If huge-page management technology is used, then page fault processing frequency decreases and system performance improves, but hardware coupling increases and granularity selection is limited
Solution Approach 1:
The patent introduces a software-based memory management intermediary layer that sits between the application and the hardware memory management unit. This intermediary handles huge page allocation and management through software, reducing direct hardware coupling while maintaining the performance benefits of huge pages. The software layer translates high-level memory requests into hardware-appropriate page allocations.
Solution Approach 2:
The memory management system is designed to support multiple page sizes (conventional pages and huge pages) through a unified software interface. This universal approach allows the same memory management mechanism to serve different granularity requirements without requiring separate hardware paths, thereby reducing hardware complexity while maintaining performance advantages.
3Speed
If huge-page management technology is used, then memory access efficiency improves, but memory overheads increase and compatibility issues arise
Solution Approach 1:
The patent applies different page sizes to different memory regions based on their access patterns and requirements. Frequently accessed large contiguous memory regions use huge pages for efficient access, while other regions use conventional pages. This local optimization reduces overall memory overhead while maintaining high access efficiency where needed.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
This application provides a memory management method, an electronic device, and a storage medium. The method includes: allocating a virtual memory in response to a received memory allocation request; creating a virtual memory region for the allocated virtual memory, and binding the virtual memory region to a target backend, where the backend indicates a type of a data source; determining a physical page type based on the target backend, where the physical page type includes a common-physical-page type and a huge-physical-page type; and allocating or loading a physical page based on the physical page type, and establishing a first mapping relationship between the virtual memory region and the allocated physical page or the loaded physical page. The method provided in this application helps improve memory performance and reduce memory overheads.