RFR: 8261230: GC tracing of page sizes are wrong in a few places
Thomas Stuefe
stuefe at openjdk.java.net
Thu Feb 11 17:34:38 UTC 2021
On Tue, 9 Feb 2021 19:42:15 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:
> The usage of `os::trace_page_sizes()` and friends are wrongly assuming that we always get the page size requested and needs to be updated. This is done by using the helper `ReservedSpace::actual_reserved_page_size()` instead of blindly trusting we get what we ask for. I have plans for the future to get rid of this helper and instead record the page size used in the `ReservedSpace`, but for now the helper is good enough.
>
> In G1 we used the helper but switched the order of the page size and the alignment parameter, which in turn helped the test to pass since the alignment will match the page size we expect in the test. The test had to be improved to recognize mapping failures.
Looks good. `os::trace_page_sizes_for_requested_size` is not easy to understand, especially with the alignment vs preferred_page_size semantic. Not sure what alignment has to do with preferred page size.
We could prevent these kind of errors and make the code more readable by introducing a page size enum. We only have a handful of valid values anyway.
-------------
Marked as reviewed by stuefe (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2486
More information about the hotspot-gc-dev
mailing list