RFR: 8296419: [REDO] JDK-8295319: pending_cards_at_gc_start doesn't include cards in thread buffers

Thomas Schatzl tschatzl at openjdk.org
Tue Nov 15 14:41:02 UTC 2022


On Tue, 15 Nov 2022 14:19:13 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1YoungCollector.cpp line 1094:
>> 
>>> 1092:     // Flushes deferred card marks, so must precede concatenting logs.
>>> 1093:     retire_tlabs();
>>> 1094: 
>> 
>> I was wondering whether we should do something about all the methods (`retire_tlabs`, `concatenate_dirty_card_logs...`, `calculate_collection_set`) methods here that are part of the `pre_evacuate_collection_set` phase but are now located outside of that method.
>> 
>> Looking at the `per_thread_states` parameter passed to `pre_evacuate_collection_set`, it's only used for some verification inside `pre_evacuate_collection_set`, i.e. we could move that verification and initialization of the PSSS :) after`pre_evacuate_collection_set` instead.
>> 
>> Since the change touches that code, I think it is appropriate (and better) to consolidate right away.
>> 
>> I agree about that deferring combining and parallelizing the various phases of `pre_evacuate_collection_set` can be done extra; the reason why we want parallelization of the TLAB retiring is that there can be tens of thousands threads, and even little work per thread adds up (there is a CR for that already actually, [JDK-8211104](https://bugs.openjdk.org/browse/JDK-8211104)).
>> 
>> Other than that it looks good to me.
>
> I made a prototype for this suggestion: https://github.com/openjdk/jdk/commit/587660c8ee198447ea82ddd61dc9d41f2c559daa that seems to at least compile. No testing. One may also move  `rdcqs` and `preserved_marks_set` completely into the `G1ParScanThreadStateSet` as neither is used elsewhere.

I also added that suggested refactoring here: https://github.com/openjdk/jdk/compare/pr/11053...tschatzl:jdk:pull/11053-suggestion?expand=1

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

PR: https://git.openjdk.org/jdk/pull/11053


More information about the hotspot-gc-dev mailing list