RFR: 8294847: Fix calculation of G1 effective scanned cards prediction

Kim Barrett kbarrett at openjdk.org
Tue Oct 11 18:17:39 UTC 2022


On Tue, 11 Oct 2022 11:35:01 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   can I have reviews of this change that fixes the prediction of the actually to be scanned cards?
> 
> In particular, the current code completely misses the log buffer cards in the "effective" number of scanned cards. The change simply assumes that all pending log buffer cards are going to be scanned, ignoring duplicates.
> 
> Other changes are just removing related, unused or unnecessary code.
> 
> Depends on PR#10644, 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
> 
> Thanks,
>   Thomas

Changes requested by kbarrett (Reviewer).

src/hotspot/share/gc/g1/g1Analytics.hpp line 144:

> 142: 
> 143:   // Predict how many of the given remembered set of length rs_length will add to
> 144:   // the number of total cards scanned.

I'm having a very hard time parsing that comment.  I _think_ it is equivalent to "Predict how many cards in a remembered set of length rs_length will need to be scanned."

src/hotspot/share/gc/g1/g1Policy.cpp line 1015:

> 1013:   // Assume that all cards from the log buffers will be scanned, i.e. there are no
> 1014:   // duplicates in that set.
> 1015:   size_t effective_scanned_cards = _analytics->predict_scan_card_num(rs_length, collector_state()->in_young_only_phase()) + pending_cards;

Consider breaking up this very long line.

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

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



More information about the hotspot-gc-dev mailing list