RFR: 8261029: Code heap page sizes not traced correctly using os::trace_page_sizes

Stefan Johansson sjohanss at openjdk.java.net
Tue Feb 9 15:06:05 UTC 2021


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`.

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

Commit messages:
 - 8261029: Code heap page sizes not traced correctly using os::trace_page_sizes

Changes: https://git.openjdk.java.net/jdk/pull/2481/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2481&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261029
  Stats: 9 lines in 1 file changed: 1 ins; 6 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2481.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2481/head:pull/2481

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


More information about the hotspot-compiler-dev mailing list