RFR: 8261527: Record page size used for underlying mapping in ReservedSpace

Stefan Johansson sjohanss at openjdk.java.net
Thu Apr 29 20:55:29 UTC 2021


Please review this change to use the actual page size rather than `bool large` when creating and initializing `ReservedSpace`. This allows us to then get rid of the helper `ReservedSpace::actual_reserved_page_size()` and instead use the "real" page size for logging and other use.

The PR consist of two commits, one that changes `ReservedSpace` to use and store a page size and one that removes `actual_reserved_page_size()` and instead uses `ReservedSpace::page_size()`. Hopefully this might help ease the review a bit. 

There are two changes in behavior:
* In `JfrVirtualMemorySegment::initialize()` we now always pass down `os::vm_page_size()` which means never use large pages. This differs from the old condition where large pages were enabled if transparent huge pages were enabled. This change has been discussed with the JFR team and they will later investigate how to re-enable large page use.
* In `ReservedSpace::reserve()`, if a file is used, the page size is always set to `os::vm_page_size()`. So when logging the page_size for such mapping it will not report a large page size. This was incorrectly done in the past when using `ReservedSpace::actual_reserved_page_size()` to figure out the page size. This makes the `runtime/os/TestTracePageSizes.java` test pass even if run with `-XX:AllocateHeapAt=/tmp`.

**Testing**
Mach5 tier1-4 and a lot of local testing.

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

Commit messages:
 - Use ReservedSpace.page_size() instead of actual_reserved_page_size()
 - 8261527: Record page size used for underlying mapping in ReservedSpace

Changes: https://git.openjdk.java.net/jdk/pull/3802/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3802&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261527
  Stats: 135 lines in 20 files changed: 18 ins; 26 del; 91 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3802.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3802/head:pull/3802

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


More information about the shenandoah-dev mailing list