RFR: 8223961: ZGC: Unexpected behaviour was observed caused by the incorrect update of _nticks in ZMetronome::wait_for_tick()

Jie Fu fujie at loongson.cn
Wed May 15 14:33:21 UTC 2019


Hi all,

JBS: https://bugs.openjdk.java.net/browse/JDK-8223961

Please review the following patch which fixes the update of "_nticks" in 
ZMetronome::wait_for_tick()
-----------------------------------
diff -r b0b20413d853 src/hotspot/share/gc/z/zMetronome.cpp
--- a/src/hotspot/share/gc/z/zMetronome.cpp     Wed May 15 11:53:47 2019 
+0200
+++ b/src/hotspot/share/gc/z/zMetronome.cpp     Wed May 15 20:15:39 2019 
+0800
@@ -57,6 +57,8 @@
      if (!_stopped && timeout_ms > 0) {
        // Wait
        ml.wait(timeout_ms);
+    } else if (timeout_ms < -1 * (int64_t)_interval_ms) {
+      _nticks += -timeout_ms / _interval_ms;
      } else {
        // Tick
        return !_stopped;
-----------------------------------
For more info, please see the JBS.

Testing:
   - make test TEST="hotspot_gc" CONF=release

Thanks a lot.
Best regards,
Jie





More information about the hotspot-gc-dev mailing list