RFR: 8261029: Code heap page sizes not traced correctly using os::trace_page_sizes
Vladimir Kozlov
kvn at openjdk.java.net
Tue Feb 9 18:47: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`.
I think the difference comes from JDK-8087339 changes which did not update this code:
https://github.com/openjdk/jdk/commit/925a508b2bb1600909418405e9e5ea1a93a94580
I agree that alignment here should match one used in CodeCache::reserve_heap_memory() and not recalculated. But I am not sure actual_reserved_page_size() returns correct value.
May be we should record value in CodeHeap object when it is created.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2481
More information about the hotspot-compiler-dev
mailing list