RFR: 8259349: -XX:AvgMonitorsPerThreadEstimate=1 does not work right [v4]

Daniel D.Daugherty dcubed at openjdk.java.net
Fri Jan 8 23:20:57 UTC 2021


On Fri, 8 Jan 2021 23:09:00 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Daniel D. Daugherty has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   delete bad assert found by linux build.
>
> src/hotspot/share/runtime/synchronizer.cpp line 1173:
> 
>> 1171:   Atomic::add(&_in_use_list_ceiling, (jint)-AvgMonitorsPerThreadEstimate);
>> 1172: }
>> 1173: 
> 
> Did you find that this can go negative?  I can see that it could go to zero at shutdown maybe.

In a previous round I changed the assert to:
(l_in_use_list_ceiling >= 0, ...```
and the Linux build complained about the assert always being true.
This is because size_t is unsigned. (No complaint on macOSX.)

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

PR: https://git.openjdk.java.net/jdk/pull/1992


More information about the hotspot-runtime-dev mailing list