RFR: 8341379: Shenandoah: Improve lock contention during cleanup
Paul Hohensee
phh at openjdk.org
Wed Oct 2 21:16:37 UTC 2024
On Thu, 26 Sep 2024 21:08:11 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
> This change improves the efficiency of cleaning up (recycling) regions that have been trashed by GC effort. The affected code runs at the end of FinalMark to reclaim immediate garbage. It runs at the end of FinalUpdateRefs to reclaim the regions that comprised the collection set, from which all live objects have now been evacuated.
>
> Efficiency improvements include:
> 1. Rather than invoking the os (while holding the Heap lock) to obtain the time twice for every region recycled, we invoke the os only once for each batch of 32 regions that are to be processed.
> 2. Rather than enforcing that the loop runs no longer than 30 us, we refrain from starting a second batch of regions if more than 8 us has passed since the preceding batch was processed.
>
> Below, each trial runs for 1 hour, processing 28,000 transactions per second.
>
> Without this change, latency for 4 un-named business services is represented by the following chart:
> 
>
> With this change, latency for the same services is much better:
> 
>
> A comparison of the two is provided by the following:
> 
I worry that we're hard-coding assumed task durations. I'm ok with this PR as it is, but I suggest we add a facility to GC initialization that does dummy tasks such as this in order to get somewhat-realistic times for use in this kind of situation.
-------------
Marked as reviewed by phh (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/21211#pullrequestreview-2344117544
More information about the hotspot-gc-dev
mailing list