RFR: 8266821: G1: Prefetch cards during merge heap roots phase [v2]

Kim Barrett kbarrett at openjdk.java.net
Wed May 12 18:47:24 UTC 2021


On Wed, 12 May 2021 07:45:36 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Hi all,
>> 
>>   can I have reviews for this change that improves performance of the merge heap roots phase in g1?
>> 
>> Merging heap roots (remembered sets and log buffers) into the card table for later scanning to a large degree constitutes random accesses to the card table.
>> 
>> Putting a small prefetch queue between calculating the card table address and inspecting the given card table value decreases merge remembered set time by 20-30% and merge log buffers time by 40-50% (on x64. AArch64 shows similar if not better improvements).
>> 
>> Applications not having a significant amount of either remembered sets or log buffers do not show significant difference. 
>> 
>> The cache size constants for arm64 and x86 were derived from testing with a benchmark creating lots of references and log buffers (i.e. BigRamTester). Could not do any corresponding tests on other architectures due to lack of machines.
>> 
>> Testing: tier1-3, lots of tier1-tier8 runs with [JDK-8017163](https://bugs.openjdk.java.net/browse/JDK-8017163).
>
> Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
> 
>   kbarrett review

One minor nit, otherwise looks good.

src/hotspot/share/gc/g1/g1RemSet.cpp line 1085:

> 1083:   G1CardTable::CardValue _dummy_card;
> 1084: 
> 1085:   ~G1MergeHeapRootsPrefetchCache() { }

Better would be a defaulted definition, i.e. `~G1MergeHeapRootsPrefetchCache() = default;`

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

Marked as reviewed by kbarrett (Reviewer).

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


More information about the hotspot-dev mailing list