RFR: 8294842: Pass actual pending cards to G1Policy::update_young_length_bounds during young gen revise
Thomas Schatzl
tschatzl at openjdk.org
Wed Oct 12 07:30:21 UTC 2022
On Tue, 11 Oct 2022 18:43:57 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Hi all,
>>
>> can I have reviews for this change that passes the actual amount of pending cards to `G1Policy::update_young_length_bounds` instead of some prediction during young gen revising?
>> That improves predictions quite a bit.
>>
>> Depends on PR#10647, so please review that one first.
>>
>> Testing: gha, local testing, tier1-5 with other changes in this patch series, perf testing with other changes in this patch series
>
> src/hotspot/share/gc/g1/g1Policy.cpp line 198:
>
>> 196: void G1Policy::update_young_length_bounds() {
>> 197: // We have no measure of the number of pending cards in the thread buffers,
>> 198: // assume these are very few.
>
> `predict_pending_cards()` includes the cards that were thread buffers. It is based on the cards that were processed, which is done after DCQS::concatenate_logs.
Looking at the code:
`G1Policy::record_concurrent_refinement_stats` sets `_pending_cards_at_gc_start = dcqs.num_cards()`; `record_concurrent_refinement_stats` is called in `G1Policy::record_young_collection_start`; in `G1YoungCollector::collect`, `record_young_collection_start` is called _before_ `pre_evacuate_collection_set` which calls `G1BarrierSet::dirty_card_queue_set().concatenate_logs`.
I seem to be missing something, can you clarify?
> src/hotspot/share/gc/g1/g1Policy.cpp line 531:
>
>> 529: G1DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set();
>> 530: // We have no measure of the number of cards in the thread buffers, assume
>> 531: // these are very few compared to the ones in the DCQS.
>
> I think it's really that the #cards in thread buffers is very small compared to the sum of the other two sources.
Note that this comment does not say that what is assumed here is actually valid in all cases, but for now it suffices I guess.
-------------
PR: https://git.openjdk.org/jdk/pull/10649
More information about the hotspot-gc-dev
mailing list