JDK-8252126 : 'GVars.stw_random = os::random()' lost by JDK-8246476
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2020-08-20
  • Updated: 2020-08-27
  • Resolved: 2020-08-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b13Fixed
Related Reports
Relates :  
Relates :  
Description
The fix for the following bug:

    JDK-8246476 remove AsyncDeflateIdleMonitors option and the safepoint based deflation mechanism

lost the following line of code:

$ hg export 9c9e71164fa7 | grep 'GVars.stw_random = '
-  GVars.stw_random = os::random();

Thanks to Erik O. for noticing this accidental deletion.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/042c2fd73a71 User: dcubed Date: 2020-08-21 20:00:57 +0000
21-08-2020

Here's the proposed fix: $ hg diff -r qparent diff -r 8f73aeccb27c src/hotspot/share/runtime/synchronizer.cpp --- a/src/hotspot/share/runtime/synchronizer.cpp Thu Aug 20 11:12:00 2020 -0700 +++ b/src/hotspot/share/runtime/synchronizer.cpp Thu Aug 20 16:36:38 2020 -0400 @@ -2322,6 +2322,8 @@ Atomic::load(&om_list_globals._free_count), Atomic::load(&om_list_globals._wait_count)); + GVars.stw_random = os::random(); + // The ServiceThread's async deflation request has been processed. _last_async_deflation_time_ns = os::javaTimeNanos(); set_is_async_deflation_requested(false); The equivalent location to ObjectSynchronizer::finish_deflate_idle_monitors() is in ObjectSynchronizer::deflate_idle_monitors_using_JT() after the similar logging message: log_info(monitorinflation)("async global_population=%d, global_in_use_count=%d, " "global_free_count=%d, global_wait_count=%d", Atomic::load(&om_list_globals._population), Atomic::load(&om_list_globals._in_use_count), Atomic::load(&om_list_globals._free_count), Atomic::load(&om_list_globals._wait_count));
20-08-2020

GVars.stw_random used to set by this line of code: GVars.stw_random = os::random(); at the end of ObjectSynchronizer::finish_deflate_idle_monitors(). When that function was deleted by JDK-8246476, that line of code was lost. When the following fix was integrated: JDK-8153224 Monitor deflation prolong safepoints that bit of code should have been copied to the AsyncDeflateIdleMonitors code so that the GVars.stw_random variable was also set when AsyncDeflateIdleMonitors == true.
20-08-2020