RFR: 8304144: G1: Remove unnecessary is_survivor check in G1ClearCardTableTask
Y. Srinivas Ramakrishna
ysr at openjdk.org
Sat Mar 18 06:06:23 UTC 2023
On Thu, 16 Mar 2023 13:12:34 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> @tschatzl & @albertnetymk :
>>
>> I'd suggest adding an assert that the region for which cards are being cleared is not a survivor region, with a comment to that effect. That would safely take care of both of your intentions/comments here.
>>
>> Otherwise looks good.
>
>>I'd suggest adding an assert that the region for which cards are being cleared is not a survivor region,
>
> That check existed before https://bugs.openjdk.org/browse/JDK-6819061 (more than a decade ago), so can't really say what the original intention was.
>
> Viewing it with fresh eyes, mentioning anything around "survivor" in this context is weird -- from the surrounding code one can not say whether the current region should or should not be a "survivor".
>
> (For testing purposes, I added an assert there and it was never triggered.)
@albertnetymk :
I am not sure if this is stil relevant today or is a fragment of code that has outlived its usefulness (I must confess I have not looked closely at or kept up with G1's evolution, especially wrt concurrent refinement, over the last few years, but note that @tschatzl must have been thinking of the allocation in survivor regions that dirties the backing cards using the following API):
// It dirties the cards that cover the block so that the post
// write barrier never queues anything when updating objects on this
// block. It is assumed (and in fact we assert) that the block
// belongs to a young region.
inline void dirty_young_block(HeapWord* start, size_t word_size);
You should check what the post-write barrier does today before it enqueues dirty pointers. Hence the comment about not clearing cards for survivor (or young) regions.
-------------
PR: https://git.openjdk.org/jdk/pull/13023
More information about the hotspot-gc-dev
mailing list