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

David Holmes dholmes at openjdk.java.net
Fri Jan 8 06:44:59 UTC 2021


On Fri, 8 Jan 2021 03:09:11 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> This is a trivial fix to make the "-XX:AvgMonitorsPerThreadEstimate"
>> option work correctly for values < 1024.
>> 
>> I've locally built and tested this fix on my MBP13. It will be included in my
>> next Mach5 Tier[1-3] testing batch.
>
> Daniel D. Daugherty has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix build error on windows.

Hi Dan,

The fix is fine in principle, but some comments below.

Thanks,
David

src/hotspot/share/runtime/synchronizer.cpp line 1187:

> 1185:   // but in reality the ceiling should never get that high.
> 1186:   _in_use_list_ceiling = (jint)new_value;
> 1187: }

I'm sure I must have asked this before but why is AvgMonitorsPerThreadEstimate typed as `intx` rather than `int`? A `jint is 32-bit and so is `int` on all our 32-bit and 64-bit platforms; whereas `intx` is 64-bit on a 64-bit system.

And if we only ever set this field once why introduce a seemingly general use setter function instead of just doing the initialization directly in the initialize() method?

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

Changes requested by dholmes (Reviewer).

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


More information about the hotspot-runtime-dev mailing list