1GB pages and Transparent Huge Pages (Linux)
Asked Answered
C

1

8

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?

Camala answered 18/10, 2012 at 16:46 Comment(0)
N
12

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.

Nautical answered 18/10, 2012 at 17:43 Comment(4)
Thanks. This is very helpful. As follow up question: Do you know if this is a fundamental constraint or a temporary one?Camala
I don't know the details on x86_64 huge page support, but I do know that other platforms have different sizes available. For instance, IBM power does 64KB and 16GB, and I think some others.Teleran
So, even if hardware supports 1GB pages, THP only works with 2MB/4MB?Cheesewood
No, THP works with the page sizes supported by the hardware.Dov

© 2022 - 2024 — McMap. All rights reserved.