Multi-Granularity Memory Allocation to Reduce Page Metadata Overhead
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing memory management methods result in significant overheads due to the creation of page frame metadata based on a fixed granularity, leading to waste and inefficient allocation of physical memory, especially in scenarios requiring different granularities.
Innovation Solution
Create page frame metadata based on a huge page granularity and dynamically adjust the physical page allocation based on the memory requirements of a process, allowing for allocation at multiple granularities to reduce metadata management overheads and improve efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of energy
If page frame metadata is created based on fixed basic page granularity (4KB), then memory management overhead is low and performance is stable, but significant metadata waste occurs in huge page scenarios (waste rate reaches 99.8%)
Solution Approach 1:
The patent implements dynamic page granularity adjustment by introducing a page granularity determination module that selects between first granularity (basic page) and second granularity (huge page) based on process memory requirements. This dynamic selection mechanism allows the system to adapt the page size to actual needs, avoiding the fixed granularity limitation and reducing metadata waste in huge page scenarios while maintaining low overhead in basic page scenarios.
2Loss of substance
If huge page granularity is used for memory management, then metadata waste is reduced, but allocation flexibility for different process requirements deteriorates
Solution Approach 1:
The patent segments the memory management system into multiple granularity levels (first granularity for basic pages, second granularity for huge pages) and introduces a determination mechanism that divides processes into first processes (suitable for basic pages) and second processes (suitable for huge pages). This segmentation allows the system to apply appropriate granularity to different processes, reducing overall metadata waste while maintaining allocation flexibility through the determination module.
3Adaptability or versatility
If multiple page granularities are supported simultaneously, then allocation requirements of different processes are met, but system complexity increases
Solution Approach 1:
The patent implements a universal page frame metadata structure that can represent multiple granularities through a granularity indication field. The page frame metadata includes a first field indicating page granularity, allowing the same metadata structure to handle both basic pages and huge pages. This multi-functional approach enables the system to support multiple granularities without creating separate management systems, thus reducing complexity while maintaining allocation flexibility.
Data Source
Figure 1
Figure 2(a)~2(b)
Figure 3
AI summary
This application provides a memory management method. The method includes: dividing a physical memory into N first physical pages based on a first granularity, and creating N pieces of first page frame metadata corresponding to the N first physical pages, where the first granularity is greater than a minimum granularity supported by a computer device; determining, based on a request of a first process, a size of a physical memory required by the first process; and choosing, based on the size of the physical memory required by the first process, to allocate O first physical pages to the first process at the first granularity, or choosing to allocate Q second physical pages to the first process at a second granularity, or choosing to allocate W first physical pages to the first process at the first granularity and allocate T second physical pages to the first process at the second granularity. In this application, the page frame metadata is created for the physical memory based on a huge page granularity, and then whether to further refine the physical page is determined based on the size of the physical memory required by the first process, so that management overheads of the page frame metadata can be reduced.