RFR: 8325857: G1 Full GC flushes mark stats cache too early

Ivan Walulya iwalulya at openjdk.org
Fri Feb 23 12:59:53 UTC 2024


On Fri, 23 Feb 2024 10:31:18 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this fix that flushes mark stats cache after reference processing because that phase can mark some objects. Apart from a minor performance issue (the amount live data is used to determine whether a region is considered for the dead-wood optimization only, so at most g1 full gc compacted too much) there has been no correctness issue.
> 
> In this patch the work is performed serially because even on not-so-current processors this phase takes < 1ms for up to 256 threads (~0.004ms per parallel gc thread).
> 
> There is a prototype for a parallel version at https://github.com/openjdk/jdk/compare/master...tschatzl:jdk:submit/8325857-wrong-mark-cache-flush?expand=1 (ugly code) that costs, depending on the machine <= 0,1ms (slightly older machine, 36 threads) or <= 0.03ms (current machine, 256 threads), but introducing like 30 LOC + some magic constant.
> 
> I assume that one does not use/force such large #threads to run tiny applications where the other part of g1 full gc only takes time where even that 1ms matter, so saving a bit on code complexity. If somebody disagrees with that analysis, I can change the code to use the parallel version.
> Additionally g1 full gc is kind of an error condition anyway.
> 
> Testing: gha
> 
> Hth,
>   Thomas

Marked as reviewed by iwalulya (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/17979#pullrequestreview-1898052180


More information about the hotspot-gc-dev mailing list