RFR: 8261029: Code heap page sizes not traced correctly using os::trace_page_sizes
Tobias Hartmann
thartmann at openjdk.java.net
Thu Feb 11 07:49:39 UTC 2021
On Tue, 9 Feb 2021 13:45:38 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:
> When adding a code heap the page size used with the underlying mapping is traced using `os::trace_page_sizes`. The old code tried to estimate the page-size based on the size, but the mapping has already been done so it is better to check the passed in `ReservedSpace`. Today we don't record the page size in the ReservedSpace, but we have a helper to do a good estimate: `ReservedSpace::actual_reserved_page_size()`. The proposal is to use this function.
>
> When changing this I also realized that the traced min-size used un-aligned value while the actual `initialize`-call correctly uses the aligned size. Changed so that we also use the aligned size for tracing.
>
> I'm currently doing some more work in this area and while I haven't added a specific test for this issue I have created a test I plan to integrate separately when a few more needed changes have gone in. The test is Linux-only and validates the output from `os::trace_page_sizes` against the information in `/proc/self/smaps`.
Looks good to me, thanks for fixing!
-------------
Marked as reviewed by thartmann (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2481
More information about the hotspot-compiler-dev
mailing list