4A0-M05 practice question 9 of 15

Which of the following describes the benefit of using huge pages?

Full set: 56 questions
Answer options
A: Huge pages improves the performance of mapping virtual memory addresses to physical memory addresses. Correct answer
B: Huge pages improves the performance of decreasing the number of memory accesses involved in a page table walk.
C: Huge pages improves the performance of page swapping by increasing the number of TLB cache hits.
D: Huge pages improves the performance of page swapping by optimizing the loading of pages to main memory.
Correct Answer:
A. Huge pages improves the performance of mapping virtual memory addresses to physical memory addresses.
Explanation

The primary benefit of using huge pages is to improve the performance of the memory management subsystem. This is achieved by reducing the overhead associated with translating virtual memory addresses to physical memory addresses. Huge pages allow a single entry in the Translation Lookaside Buffer (TLB) to map a much larger region of physical memory (e.g., 2MB or 1GB instead of 4KB). This significantly increases the TLB hit rate, reducing the frequency of slow page table walks. When a TLB miss does occur, the page table walk itself is also faster as fewer levels of the page table need to be traversed. Option A correctly summarizes this overall performance improvement in the address mapping process.

Why Incorrect

B. This is a correct statement but describes only a secondary benefit (a faster page table walk on a TLB miss). The primary benefit, an increased TLB hit rate which avoids the walk entirely, is not mentioned.
C. While huge pages do increase TLB cache hits, they do not improve page swapping performance. Swapping a single large page is a very high-latency I/O operation, which is why huge pages are typically configured to be non-swappable.
D. This is incorrect for the same reason as option C. Huge pages are detrimental to page swapping performance due to the large, indivisible I/O operations they would require.

References

1. The Linux Kernel Documentation, hugetlbpage.rst: "The main benefit of HugeTLB is that a single TLB entry can be used for a large page... This results in a significant reduction in TLB misses and the overhead of walking page tables... For this reason, use of HugeTLB pages can significantly improve performance for applications that use large amounts of memory." The documentation also explicitly states, "HugeTLB pages are not swappable." This directly supports that the benefit is in mapping performance and refutes the claims about improving page swapping in options C and D.

(Source: Documentation/admin-guide/mm/hugetlbpage.rst in the Linux kernel source tree).

2. Nokia AirFrame OpenStack Administration Guide, 20.10, Section: CPU Pinning and Huge Pages: "Huge pages can increase performance by reducing the overhead of the Translation Lookaside Buffer (TLB). A TLB is a CPU cache of the mapping between virtual and physical memory addresses. If the virtual address is in the TLB, the mapping is fast. If not, the kernel must walk the page tables to determine the mapping, which is slow. With huge pages, a single TLB entry can map a larger memory area, increasing the TLB hit rate." This official vendor documentation confirms the benefit is improved mapping performance via the TLB.

3. Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 3A, Section 4.10 "Large Page Support": "For some workloads, use of large pages can significantly reduce the number of TLB misses and page walks, improving performance." This reference from the CPU architecture developer confirms that the performance gain comes from improving the two key components of the virtual-to-physical address mapping process.

Scroll to Top