RFR: 8308500: ZStatSubPhase::register_start should not call register_gc_phase_start if ZAbort::should_abort()
Stefan Karlsson
stefank at openjdk.org
Mon May 22 10:55:48 UTC 2023
On Mon, 22 May 2023 07:37:19 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
> `ZStatSubPhase::register_start` should not call `register_gc_phase_start` if `ZAbort::should_abort()` is true. This will cause an unbalanced push and pop behaviour of the phase stack as `ZStatSubPhase::register_end` stops popping (and sending events) after the aborting has started. This will create an issue if more subsequent sub-phases are added in-between two abort points as the phase stack may overflow.
>
> Simply avoid pushing new phases when aborting has started solves this issue.
Changes requested by stefank (Reviewer).
src/hotspot/share/gc/z/zStat.cpp line 811:
> 809:
> 810: void ZStatSubPhase::register_start(ConcurrentGCTimer* timer, const Ticks& start) const {
> 811: if (timer != nullptr && !ZAbort::should_abort()) {
`register_end` also skips the logging part if we should abort. Should we do the same for the `register_start`?
-------------
PR Review: https://git.openjdk.org/jdk/pull/14075#pullrequestreview-1436354071
PR Review Comment: https://git.openjdk.org/jdk/pull/14075#discussion_r1200344003
More information about the hotspot-gc-dev
mailing list