RFR: 8243315: ParallelScavengeHeap::initialize() passes GenAlignment as page size to os::trace_page_sizes instead of actual page size [v3]

Joakim Nordström github.com+779991+jaokim at openjdk.java.net
Thu Nov 19 09:59:09 UTC 2020


On Thu, 12 Nov 2020 10:55:06 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Joakim Nordström has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fixed whitespaces.
>>  - Added ParallelInitLogger with alignment logging
>
> src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp line 69:
> 
>> 67:                        MinHeapSize,
>> 68:                        reserved_heap_size,
>> 69:                        os::vm_page_size(),
> 
> I briefly looked at this in the past and I don't think using `os::vm_page_size()` straight off will not work for the case when large pages are used. So we need a way to figure out if the heap got reserved using large pages. Once again you can take a look at how G1 does it, it's in `actual_reserved_page_size()` in g1CollectedHeap.cpp. I'm not sure you can use that straight off, but something similar should work.

Thanks for comments! Have rearranged the the logging of this. The logic for G1 also applies to how parallel's heap is reserved.

> src/hotspot/share/gc/parallel/parallelArguments.cpp line 145:
> 
>> 143:                      byte_size_in_exact_unit(GenAlignment), exact_unit_for_byte_size(GenAlignment),
>> 144:                      byte_size_in_exact_unit(HeapAlignment), exact_unit_for_byte_size(HeapAlignment)
>> 145:                      );
> 
> As I wrote in the bug I think it makes sense to have a way to get this printed, and I think a better location might be to include it to the `gc+init` logging. Parallel doesn't have a specialized InitLogger yet, but you can create one and add it there. Take a look at `G1InitLogger` for insperation.

Thanks for your comments.
Hava added a ParallelInitLogger. Please advice whether the logged information is sufficient.

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

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


More information about the hotspot-gc-dev mailing list