RFR: 8242078: G1: Improve concurrent refinement analytics and logging
Kim Barrett
kim.barrett at oracle.com
Tue Apr 14 12:59:10 UTC 2020
> On Apr 14, 2020, at 6:22 AM, Stefan Johansson <stefan.johansson at oracle.com> wrote:
>
> Thanks for a nice clean up Kim,
>
> On 2020-04-11 00:32, Kim Barrett wrote:
>>> On Apr 9, 2020, at 4:16 AM, Thomas Schatzl <thomas.schatzl at oracle.com> wrote:
>>> […]
>>>> Thanks.
>>>> New webrevs:
>>>> full: https://cr.openjdk.java.net/~kbarrett/8242078/open.01/
> Look good in general, just a few things around logging:
> src/hotspot/share/gc/g1/g1Policy.cpp
> —
> […]
> Instead of setting up this array I would prefer to split the logging into a separate function. Unless I'm missing something we could do something like:
> mut_stats.log("Mutator");
> cr_stats.log("Concurrent");
> total_stats.log("Total");
>
> Or if you prefer to keep the G1ConcurrentRefineStats clean, use a helper that take a "stats" and a "kind”.
Done using a helper. The code used to be more complicated, making the array approach
more useful, but yeah, in the final version a helper function is better.
> ---
> 509 if (log.is_enabled()) {
> 510 log.print("Concurrent refinement rate: %.2f cards/ms", rate);
> 511 }
> ...
> 525 if (log.is_enabled()) {
> 526 log.print("Generate dirty cards rate: %.2f cards/ms", dirtied_rate);
>
> If doing the above change, I don't think we need a LogTarget and then these could just be:
> log_debug(gc, refine, stats)(…)
The LogTarget was to only say the logging selection once, but admittedly that’s not
common practice and it probably reads better being explicit, so done.
New webrevs:
full: https://cr.openjdk.java.net/~kbarrett/8242078/open.02/
incr: https://cr.openjdk.java.net/~kbarrett/8242078/open.02.inc/
Testing: local (linux-x64) hs-tier1, which includes TestGCLogMessages.
More information about the hotspot-gc-dev
mailing list