RFR: 8303908: Add missing check in VTMS_transition_disable_for_all() for suspend mode

David Holmes dholmes at openjdk.org
Fri Mar 10 04:40:13 UTC 2023


On Thu, 9 Mar 2023 18:55:06 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

> Please review this small fix. A suspender is a JvmtiVTMSTransitionDisabler monopolist, meaning VTMS_transition_disable_for_all() should not return while there is any active jvmtiVTMSTransitionDisabler. The code though is checking for active "all-disablers" but it's missing the check for active "single disablers".
> I attached a simple reproducer to the bug which I used to test the patch. Not sure if it was worth adding a test so the patch contains just the fix.
> 
> Thanks,
> Patricio

src/hotspot/share/prims/jvmtiThreadState.cpp line 372:

> 370:   java_lang_Thread::dec_VTMS_transition_disable_count(vth());
> 371:   Atomic::dec(&_VTMS_transition_disable_for_one_count);
> 372:   if (_VTMS_transition_disable_for_one_count == 0 || _is_SR) {

Sorry I don't understand why this `_is_SR` check was removed.  I admit I can't really figure out what this field means anyway, but there is nothing in the issue description that suggests this also needs changing - and it is now different to `VTMS_transition_enable_for_all`.

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

PR: https://git.openjdk.org/jdk/pull/12956


More information about the serviceability-dev mailing list