RFR: 8305896: Alternative full GC forwarding [v25]

Roman Kennke rkennke at openjdk.org
Thu May 4 06:01:27 UTC 2023


On Wed, 3 May 2023 22:05:43 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> src/hotspot/share/gc/shared/slidingForwarding.inline.hpp line 43:
>> 
>>> 41: 
>>> 42: uint SlidingForwarding::region_index_containing(HeapWord* addr) {
>>> 43:   uint index = static_cast<uint>(pointer_delta(addr, _heap_start) >> _region_size_words_shift);
>> 
>> I believe it is possible to bias the array pointer to avoid that subtraction of the `_heap_start` like we do e.g. for the card table. See also `G1BiasedArray` or so for a kind of ready-made class implementing this.
>> 
>> Not sure it will help a lot, but at least remove the subtraction and the load of the `_heap_start` value.
>
> Maybe possible ;)

I don't think so. The biasing in G1 GC (and Shenandoah GC) uses an array to look up per-region stuff (like cset property) without first calculating the actual region index. Instead, it allows to simply shift an address and use that biased index to address the biased array. Here we don't have an array, we only want the index of the region that contains the address.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13582#discussion_r1184571191


More information about the shenandoah-dev mailing list