Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple hugepage sizes in Linux (x86-64)?

Does the Linux on x86-64 support multiple huge page sizes (e.g., both 2MB and 1GB page sizes beyond the 4KB base page size)? If yes, is there a way to specify that for a given allocation which huge page size to use? In other words, my question is if "MAP_HUGETLB" flag is used while doing mmap() it maps them allocation to hugepages of default size. Is there anyway to request an allocation to be mapped on to non-default hugepage size?

like image 729
Arka Avatar asked May 07 '12 20:05

Arka


People also ask

What is the page size defined by the x86 MMU?

The default page size is fixed by what the MMU (memory management unit) of the CPU supports. In 32-bit protected mode x86 supports two kinds of pages: normal ones, 4 KiB. huge ones, 4 MiB.

What are HugePages in Linux?

So, formally defining hugepage, it is a utility that drives virtual memory management in the Linux system. And as the name itself suggests, “huge” sized pages which are in addition to the standard 4KB page size can be managed using the concept. One can easily handle pages as huge as 1GB.


1 Answers

Not quite yet, but it's working its way through the LKML. At a guess, the feature will be available in a few releases time.

You will then be able to use the flags MAP_HUGE_2MB and MAP_HUGE_1GB to configure this explicitly.

like image 50
jleahy Avatar answered Oct 18 '22 14:10

jleahy