RFR: 8256155: os::Linux Populate all large_page_sizes, select smallest page size in reserve_memory_special_huge_tlbfs* [v23]

Thomas Stuefe stuefe at openjdk.java.net
Wed Mar 17 14:58:55 UTC 2021


On Wed, 17 Mar 2021 11:37:02 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

> This would also give us to to think about a question I haven't made up my mind around. What will `LargePageSizeInBytes` mean after this change? Should the JVM use 1g pages (on a system where 2m i the default) even if `LargePageSizeInBytes` is not set?

I see two valid scenarios:
a) either use huge pages as best as possible; remove fine-grained control from user hands. So, if we have 1G pages, prefer those over 2M over 4K. Then, we could completely remove LargePageSizeInBytes. There is no need for this switch anymore.
b) or keep the current behavior. In that case, UseLargePageSize means "use at most default huge page size" even if larger pages are available; and LargePageSizeInBytes can be used to override the large page size to use.
 
(a): Its elegant, and efficiently uses system resources when available. But its an incompatible change, and the VM being grabby means we could end up using pages meant for a different process.
(b): downward compatible. In a sense. With Marcus change, we break downward compatibility already: where "UseLargePageSizeInBytes" before meant "use that or nothing", it now means "use that or whatever smaller page sizes you find". 

I prefer (a), honestly.

..Thomas

-------------

PR: https://git.openjdk.java.net/jdk/pull/1153


More information about the hotspot-dev mailing list