RFR: JDK-8256155: os::Linux Populate all large_page_sizes, select smallest page size in reserve_memory_special_huge_tlbfs* [v15]
Stefan Johansson
sjohanss at openjdk.java.net
Mon Jan 18 14:01:41 UTC 2021
On Mon, 18 Jan 2021 13:48:12 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> I think so too. The "largest possible page size..." could be solved anyway, by just retrying all configured pages sizes until we find one that works. But it would be much more efficient to just try the page size that actually could work.
>
> One also can set nr_overcommit_hugepages>0 and have a "dynamic" large page pool this way, even with nr_hugepages=0. Moreover, these settings can change during the lifetime of the VM. I would not bother adding too much logic here. Allocating huge pages may or may not fail anyway and the VM has to be prepared to deal with failure. Just my 5c.
The "dynamic part" might make this actually being "too much logic", otherwise if feels like a pretty reasonable check. The fact that huge pages can be added during the runtime of the JVM doesn't feel like a big problem, since most large reservations are done at startup.
But you might be right, since we have to handle the case of a failed mapping, it might not be to big of a problem trying all possible page sizes.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1153
More information about the hotspot-gc-dev
mailing list