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

Stefan Johansson sjohanss at openjdk.java.net
Tue May 4 09:03:53 UTC 2021


On Mon, 3 May 2021 11:04:18 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> 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.
>
> Looks good to me.

Thanks for the reviews @rkennke and @walulyai.

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

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


More information about the shenandoah-dev mailing list