RFR: 8344049: Shenandoah: Eliminate init-update-refs safepoint [v5]
William Kemper
wkemper at openjdk.org
Wed Jan 15 17:52:46 UTC 2025
On Tue, 14 Jan 2025 21:23:32 GMT, William Kemper <wkemper at openjdk.org> wrote:
>> Shenandoah typically takes 4 safepoints per GC cycle. Although Shenandoah itself does not spend much time on these safepoints, it may still take quite some time for all of the mutator threads to reach the safepoint. The occasionally long time-to-safepoint increases latency in the higher percentiles.
>>
>> The `init-update-refs` safepoint is responsible for retiring GCLABs (and PLABs) used during evacuation. Once evacuation is complete, no threads will access these LABs. This need not be done on a safepoint. `init-update-refs` is also where the global and thread local copies of the `gc_state` are updated. However, here we are turning off the `WEAK_ROOTS` flag _after_ all of the unmarked weak referents have been `nulled` out, so this does not need to happen atomically with respect to the mutators. Neither is it necessary to change the other state flags (EVACUATION, UPDATE_REFS) atomically across all mutators.
>>
>> Note that the `init-update-refs` safepoint is still taken if either verification or `ShenandoahPacing` are enabled.
>
> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 37 additional commits since the last revision:
>
> - Call out the non-java threads we are most concerned with in the comment
> - Merge tag 'jdk-25+5' into remove-init-update-refs-safepoint
>
> Added tag jdk-25+5 for changeset 2e00816a
> - Encapsulate and document a method for making concurrent gc_state changes
> - Control thread doesn't need a gc lab, also make gclabs for safepoint workers parsable
> - Improve comments and method names
> - Improve comments
> - Merge remote-tracking branch 'jdk/master' into remove-init-update-refs-safepoint
> - Fix comments
> - Fix comment, revert unnecessary change
> - Merge remote-tracking branch 'jdk/master' into remove-init-update-refs-safepoint
> - ... and 27 more: https://git.openjdk.org/jdk/compare/362f847b...ab808a11
Thank you @ysramakrishna !
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22688#issuecomment-2593579252
More information about the hotspot-gc-dev
mailing list