RFR: 8373839: Disable JVM TI suspension during JNI critical regions [v2]

Patricio Chilano Mateo pchilanomate at openjdk.org
Fri Dec 19 11:46:41 UTC 2025


On Fri, 19 Dec 2025 11:19:19 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> David Holmes has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Delay suspender whilst target is in-critical
>>  - Revert "8373839: Disable JVM TI suspension during JNI critical regions"
>>    
>>    This reverts commit 7723275e4495cc1f514c531afe752210209617cc.
>
> src/hotspot/share/runtime/suspendResumeManager.cpp line 70:
> 
>> 68:     // hang here. There is no way to time-out and abort the suspend request because
>> 69:     // the API does not allow for that - if a thread is live then it can be suspended.
>> 70:     if (target->in_critical_atomic()) {
> 
> I think the target could also pick up this operation in the native->vm transition in `ReleasexxxCritical` or even with nesting in `GetxxxCritical`, so we should check target is not current thread.

And if there is a safepoint in these transitions I realized we would deadlock because this thread will never be safepoint safe. So maybe better to move the spinning out as I suggested above?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28884#discussion_r2634832937


More information about the serviceability-dev mailing list