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

David Holmes dholmes at openjdk.java.net
Fri Jan 8 22:37:00 UTC 2021


On Fri, 8 Jan 2021 22:24:13 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:
> 
>   delete bad assert found by linux build.

Hi Dan,
Thanks for the explanations. There is more cleanup now that the type of the flag has been changed (which is why I queried that - sorry for not being clear on intent).

Thanks,
David

src/hotspot/share/runtime/globals.hpp line 718:

> 716:           range(0, max_jint)                                                \
> 717:                                                                             \
> 718:   /* notice: the max range value here is max_jint, not max_intx  */         \

The comment is no longer applicable.

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

> 255: // which is called after cmd line options are processed.
> 256: // This is a 'jint' because the range of AvgMonitorsPerThreadEstimate
> 257: // is 0..max_jint:

Do we need this comment now?

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

> 1176: }
> 1177: 
> 1178: void ObjectSynchronizer::set_in_use_list_ceiling(size_t new_value) {

new_value should just be declared as int or jint now and the cast and comments removed.

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

Changes requested by dholmes (Reviewer).

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


More information about the hotspot-runtime-dev mailing list