RFR: 8271931: Make AbortVMOnVMOperationTimeout more resilient to OS scheduling [v4]
Albert Mingkun Yang
ayang at openjdk.java.net
Mon Aug 9 08:43:05 UTC 2021
On Mon, 9 Aug 2021 05:22:23 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> disarm
>
> src/hotspot/share/runtime/vmThread.cpp line 84:
>
>> 82: // The two stores to `_armed` are counted in VM-op, but they should be
>> 83: // insignificant compared to the actual VM-op duration.
>> 84: jlong vm_op_duration = nanos_to_millis(os::javaTimeNanos() - _arm_time);
>
> You could move this ahead of the store. And then you only need a small comment in arm().
You previously commented on slack: "Also disarm before getting the end time just to shorten the race with the watcher thread". I agree with that; for non-stuck VM-ops, checking timeout on VM thread is more reliable.
> src/hotspot/share/runtime/vmThread.cpp line 89:
>
>> 87: // VMOperationTimeoutTask might miss the arm-disarm window depending on
>> 88: // the scheduling.
>> 89: assert(Thread::current()->is_VM_thread(), "Check timeout on VM thread");
>
> Seems unnecessary to assert this.
Removed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5016
More information about the hotspot-runtime-dev
mailing list