Huge Pages: The TLB Miss Reduction Strategy
Employing larger memory blocks, known as 'huge pages' (e.g., 2MB or 1GB) instead of the traditional 4KB pages, significantly reduces TLB pressure and miss rates. This optimization improves performance for memory-intensive applications by requiring fewer TLB entries to manage the same amount of memory and shortening the page table walk process.
The top 3
- Dominant Huge Page Sizes & Their TLB Efficiency: On x86-64 architectures, the default 4KiB memory pages are often replaced by common huge page sizes of 2MiB or 1GiB to reduce TLB misses. Using a 2MiB huge page, for instance, requires only one TLB entry to cover the memory space that would otherwise need 512 entries with 4KiB pages, drastically improving TLB hit rates.
- Top Workloads Benefiting Most from Huge Pages: Memory-intensive applications gain the most from huge pages, including large databases like Oracle, MySQL, and PostgreSQL, Java Virtual Machines (JVMs), High-Performance Computing (HPC) workloads, and virtualization platforms like QEMU/KVM. Google's TCMalloc, for example, saw a 7% improvement in average requests-per-second throughput by increasing huge page utilization.
- Dominant Huge Page Sizes: TLB Efficiency Kings: Modern x86-64 systems primarily leverage 2MB and 1GB huge pages; 1GB pages offer a 512x greater TLB coverage than 2MB pages, which themselves provide a 512x improvement over standard 4KB pages, drastically reducing costly TLB misses. [1, 2, 9]
Sources
Open the full topic