RFR: JDK-8156959: compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java fails with exit 134
Jiangli Zhou
jiangli.zhou at Oracle.COM
Mon Jul 25 23:04:53 UTC 2016
Please review the following webrev for JDK-8156959 <https://bugs.openjdk.java.net/browse/JDK-8156959> fix.
http://cr.openjdk.java.net/~jiangli/8156959/webrev.00/
The SensorInfo::has_pending_requests() is not thread safe. It tests '_pending_trigger_count > 0 || _pending_clear_count > 0’. In rare cases, there is a race condition in which the check done by the service thread might return ‘false’ incorrectly while _pending_trigger_count is incremented to 1 and _pending_clear_count is reset to 0 by other thread. In that case, the 'assert(has_pending_requests(), "Must have pending request”)’ in SensorInfo::process_pending_requests() becomes invalid. The fix removes the invalid assert.
As _pending_trigger_count can only be decremented by the service thread and all other threads can only increment the _pending_trigger_count, the race condition issue of SensorInfo::has_pending_requests() is harmless in other usages. If the service thread fails to catch the pending request (when has_pending_requests() returns false incorrectly), it can catch the it in the next iteration. Please see the JDK-8156959 <https://bugs.openjdk.java.net/browse/JDK-8156959> for detailed analysis.
Test: JPRT and RBT hotspot_all.
Thanks,
Jiangli
More information about the hotspot-runtime-dev
mailing list