RFR: 8256155: Allow multiple large page sizes to be used on Linux [v27]

Stefan Johansson sjohanss at openjdk.java.net
Mon Apr 26 08:21:31 UTC 2021


On Fri, 23 Apr 2021 22:34:16 GMT, Marcus G K Williams <github.com+168222+mgkwill at openjdk.org> wrote:

> > an easy approach should be to just remove all large page sizes larger than the decided maximum from _page_sizes.
> 
> It seemed easier to forgo adding large page sizes if they were less than `LargePageSizeInBytes` and `LargePageSizeInBytes != 0` or default. Please let me know if the solution seems appropriate.
> 

Sure, this is fine as well. I have some comments bug will post them in the code. 

> > The warning should go away since it is documented to mean use the default.
> > Done. Feedback there would also be helpful.
> 
> I'm seeing one failure with the TestTracePageSizes test that I'm yet to figure out. On a run with `run main/othervm -XX:+AlwaysPreTouch -Xlog:pagesize:ps-%p.log -XX:+UseSerialGC -XX:+UseTransparentHugePages TestTracePageSizes`
> reason: User specified action: run main/othervm -XX:+AlwaysPreTouch -Xlog:pagesize:ps-%p.log -XX:+UseSerialGC -XX:+UseTransparentHugePages TestTracePageSizes
> ...
> Added range: [43a400000, 440000000) pageSize=4KB isTHP=false isHUGETLB=false
> Added range: [440000000, 480000000) pageSize=4KB isTHP=true isHUGETLB=false
> Added range: [480000000, 57c2a0000) pageSize=4KB isTHP=false isHUGETLB=false
> 
> Two guesses so far: It seems like a possible issue with `ReservedSpace::actual_reserved_page_size` returning the wrong page size. Or could this base page address be 4k padding for THP largepage?

This seems to be a problem with the test, it assumes that the whole range for the heap should be using the same page size but for THP this might not be true since it is up to the system to decide. Been able to reproduce it locally as well and it seems more likely to happen when the heap large, might be that the whole range can't be satisfied with large pages and for some reason the system decides to not use them for the first range `[43a400000, 440000000)`. This range is still 2M aligned, so it should be able to.

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

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



More information about the hotspot-gc-dev mailing list