RFR: 8271195: Use largest available large page size smaller than LargePageSizeInBytes when available [v3]

Swati Sharma duke at openjdk.java.net
Mon Feb 7 12:18:08 UTC 2022


On Mon, 7 Feb 2022 09:33:34 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

> > Your proposed fix is not going to fix the alignment which will be incorrect wrt. the page_size and it may result into internal fragmentation within virtual address space which by the way is not a constraint but is a minor functional issue. Also we are leaving incorrect value in _large_page_size(global variable) which is being used at several places.
> 
> Correct, the alignment will be that of the initial requested/configured large page size, but any smaller large page size will still be aligned wrt to this alignment. I don't see any real problem with this. Sure we will require the reservation to be aligned to something larger that finally needed, but given that the number of such reservations won't be very many I think using this kind of fallback mechanism is ok.
> 
> Regarding the value left in `_large_page_size`, yes at startup this value was not usable but it is the configured value for the JVM (either by being the default for the system or by passing LargePageSizeInBytes). The discussions in the passed have lead to not changing this since that might lead to more confusing behavior.
> 
> > Seek your opinion if above issues will not impact the functionality in any manner.
> 
> One problem, that is kind of related to this (and also was on my backlog to investigate), is that we are using `os::large_page_size()` as the alignment for the heap. This means that if you request a 128m heap with a 512m large page size the heap will be aligned up to 512m. This happens regardless if 512m pages are available or not, so it is kind of a different issue. The heap alignment should probably do something similar as other reservations and use ´os::page_size_for_region(...)´. There might also be additional things related to this, where the use of `os::large_page_size()` should be looked at because we allow multiple large page sizes to be used.
> 
> Another thing that has been discussed in the passed is how to handle the logging around this. Currently you need to enable logging with `pagesize` (`-Xlog:pagesize`) to get feedback on the configuration, it might make sense to move parts of this to a level that is always shown:
> 
> ```
> [0.001s][info][pagesize] Using the default large page size: 512M
> [0.001s][info][pagesize] Usable page sizes: 64k, 2M, 512M
> [0.001s][info][pagesize] Large page size (512M) failed sanity check, checking if smaller large page sizes are usable
> [0.001s][info][pagesize] Large page size (2M) passed sanity check
> ```

Hi @kstefanj ,

Are you suggesting that its ok not to honor the alignment which is based on the original large page size?

Thanks and Regards,
Swati Sharma

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

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



More information about the hotspot-gc-dev mailing list