Shared Large Page Memory Allocation for TLB Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for loading shared libraries into virtual memory are inefficient, particularly in utilizing large pages to store both text and data sections, leading to increased translation lookaside buffer (TLB) entries and potential TLB misses, which can impact system performance.
Innovation Solution
The method involves storing the text section of a shared library in a shared large page of virtual memory and the data section in separate pages, with a predefined distance that is larger than the large page size, and using a shared page table to map these pages across multiple processes, reducing the number of TLB entries and improving memory management.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If shared libraries are loaded using conventional page sizes, then memory management is simplified, but the number of TLB entries increases leading to more TLB misses and reduced system performance
Solution Approach 1:
The patent merges multiple conventional pages into a single large page (e.g., 4MB) to store the text section of shared libraries. This consolidation reduces the number of TLB entries required from multiple individual page entries to just one large page entry, thereby reducing TLB misses and improving system performance while maintaining efficient memory management
2Quantity of substance
If text and data sections are stored in separate large pages, then memory efficiency is improved, but the address space requires larger predefined distances
Solution Approach 1:
The patent segments the shared library into two distinct parts: the text section stored in a shared large page and the data section stored in separate conventional pages. This segmentation allows the read-only text section to benefit from large page memory efficiency while the writable data section maintains its own separate management, optimizing overall memory usage despite requiring larger address space distances
3Adaptability or versatility
If conventional pages are used for shared libraries, then address space allocation is simpler, but memory utilization is suboptimal leading to increased TLB misses
Solution Approach 1:
The patent applies different page sizes to different sections of the shared library based on their specific requirements: large pages (4MB) are used for the text section to maximize memory utilization and reduce TLB misses, while conventional smaller pages are used for the data section. This localized optimization improves overall memory utilization without requiring complete restructuring of the address space allocation system
Data Source
AI summary
A method for loading shared libraries. The method includes receiving an indication of a requirement to load the shared library into the virtual memory and determining that the shared library is a candidate for using shared large pages. Further, the method includes, in response to the determination, storing a text section of the shared library in a shared large page of the virtual memory and storing a data section of the shared library in a page of the virtual memory, where the virtual memory is mapped to a physical memory of the computer, where, within an address space of the virtual memory, a starting address of the text section of the shared library is separated from a starting address of the data section of the shared library by a predefined distance, and where the predefined distance is larger than a size of the large page.


