Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

1GB pages and Transparent Huge Pages (Linux)

The Transparent Huge Pages(THP) support in recent Linux kernels allows automatic promotion/demotion between different page sizes (e.g., 4KB and 2MB in x86-64).

But I am not sure if THP can also promote/demote page sizes between 4KB and 1GB pages or between 2MB and 1GB pages.

Can somebody comment on this?

like image 331
Arka Avatar asked Oct 18 '12 16:10

Arka


People also ask

What is transparent huge pages Linux?

Transparent Huge Pages (THP) is a Linux memory management system that reduces the overhead of Translation Lookaside Buffer (TLB) lookups on machines with large amounts of memory by using larger memory pages.

What is the size of huge pages in Linux?

HugePages is useful for both 32-bit and 64-bit configurations. HugePage sizes vary from 2 MB to 256 MB, depending on the kernel version and the hardware architecture.


1 Answers

According to this article

http://lwn.net/Articles/423584/

The current patch only works with anonymous pages; the work to integrate huge pages with the page cache has not yet been done. It also only handles one huge page size (2MB). Even so, some useful performance improvements can be seen. Mel Gorman ran some benchmarks showing improvements of up to 10% or so in some situations. In general, the results were not as good as could be obtained with hugetlbfs, but THP is much more likely to actually be used.

So, it seems that THP support implemented for 4k -> 2M/4M merging/splitting.

Also, in kernel sources I've seen that there is a split_huge_page_pmd function and as PMD undergoes to splitting and PMD manages page entries on top of PTE's that has a fixed 4k size I supposed that PMD size (2M/4M) is the maximum transparent huge page size.

like image 197
Ilya Matveychikov Avatar answered Oct 18 '22 00:10

Ilya Matveychikov