RFR: JDK-8305507 Add support for grace period before AbortVMOnSafepointTimeout triggers [v2]
David Holmes
dholmes at openjdk.org
Mon May 8 06:44:24 UTC 2023
On Fri, 28 Apr 2023 16:23:49 GMT, Wojciech Kudla <duke at openjdk.org> wrote:
>> src/hotspot/share/runtime/safepoint.cpp line 788:
>>
>>> 786: // To debug the long safepoint, specify both AbortVMOnSafepointTimeout &
>>> 787: // ShowMessageBoxOnError.
>>> 788: if (AbortVMOnSafepointTimeout && Management::ticks_to_ms(os::elapsed_counter()) > (jlong)AbortVMOnSafepointTimeoutDelay) {
>>
>> Rather than use the Management API here perhaps just:
>>
>> if (AbortVMOnSafepointTimeout
>> && (os::elapsedTime() * MILLIUNITS > AbortVMOnSafepointTimeoutDelay)) {
>>
>> ?
>
> To my understanding `os::elapsedTime() * MILLIUNITS` will reduce the granularity of the grace period down to a second but I fully agree this is nicer and we don't need millis for this functionality.
> Thank you for the suggestion, @dholmes-ora
`os::elapsedTime()` returns a double so has fractional seconds.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13386#discussion_r1187079468
More information about the hotspot-runtime-dev
mailing list