RFR: 8306825: Monitor deflation might be accidentally disabled by zero intervals
Daniel D. Daugherty
dcubed at openjdk.org
Wed Apr 26 20:32:23 UTC 2023
On Tue, 25 Apr 2023 09:55:10 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Found this mistake while backporting [JDK-8305994](https://bugs.openjdk.org/browse/JDK-8305994): if we put GuaranteedAsyncDeflationInterval=0 (defined as "disable guaranteed deflation"), then the MonitorDeflationThread would call `wait(0)`, that is, wait indefinitely for the notify. This breaks triggering the threshold heuristics!
>
> But what is even more concerning, the same thing would happen even prior to [JDK-8305994](https://bugs.openjdk.org/browse/JDK-8305994), if we put GuaranteedSafepointInterval=0 too. Which means users who kept GSI=0 as the way to dodge excess safepoints, now effectively disable monitor deflation!
>
> New test cases capture most of the interesting paths/combinations. Since I needed to add more test cases, I ended up refactoring the test for more clarity. The test is also renamed, because now it tests not only GADI, but other intervals too.
Just a couple of questions about the test. Thumbs up.
I'll do another round of Mach5 testing for this fix.
test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java line 174:
> 172: "-XX:GuaranteedAsyncDeflationInterval=0",
> 173: "-XX:AsyncDeflationInterval=0",
> 174: "-XX:MonitorUsedDeflationThreshold=0",
But... this one isn't an interval option...
test/hotspot/jtreg/runtime/Monitor/DeflationIntervalsTest.java line 182:
> 180: // Try with all heuristics thresholds at zero
> 181: test(Disabled.NO, Guaranteed.NO, Threshold.NO,
> 182: "-XX:GuaranteedAsyncDeflationInterval=0",
But... this one isn't a threshold option...
-------------
Marked as reviewed by dcubed (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13635#pullrequestreview-1402738510
PR Review Comment: https://git.openjdk.org/jdk/pull/13635#discussion_r1178347824
PR Review Comment: https://git.openjdk.org/jdk/pull/13635#discussion_r1178348498
More information about the hotspot-runtime-dev
mailing list