سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top