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

Stefan Johansson sjohanss at openjdk.java.net
Tue Feb 9 19:25:37 UTC 2021


On Tue, 9 Feb 2021 18:44:27 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

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

Yes, the `actual_reserved_page_size()` is far from perfect and I plan to update `ReservedSpace` to have a page size member that can be queried in places like this and then we can remove this helper. This will be required once we allow multiple large page sizes ([PR#1153](https://github.com/openjdk/jdk/pull/1153)). That said, `actual_reserved_page_size()` is currently doing a good job returning the correct page size since it is considering both if the space is "special", what alignment it used and if transparent huge pages are enabled.

I would prefer doing the change that records the page size i `ReservedSpace` as a separate patch and in that patch also remove all uses of `actual_reserved_page_size()`. Doing this change now is required to be able to integrate the [new test](https://github.com/openjdk/jdk/compare/master...kstefanj:test-for-trace-page-sizes) I mentioned, and I think it will be helpful for work in this area going forward.

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

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


More information about the hotspot-compiler-dev mailing list