RFR: 8259349: -XX:AvgMonitorsPerThreadEstimate=1 does not work right [v6]
Daniel D.Daugherty
dcubed at openjdk.java.net
Tue Jan 12 14:43:03 UTC 2021
On Tue, 12 Jan 2021 08:41:00 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Daniel D. Daugherty has updated the pull request incrementally with one additional commit since the last revision:
>>
>> change AvgMonitorsPerThreadEstimate from int to size_t and _in_use_list_ceiling from jint to size_t.
>
> src/hotspot/share/runtime/synchronizer.cpp line 1167:
>
>> 1165:
>> 1166: void ObjectSynchronizer::dec_in_use_list_ceiling() {
>> 1167: Atomic::add(&_in_use_list_ceiling, -AvgMonitorsPerThreadEstimate);
>
> Don't you need to cast AMPTE to a signed type to take the negative of it?
> Why not just use Atomic::sub?
Apparently no cast is needed since the current patch
passes Mach[1-3]. I don't remember the reason that
Atomic::add() of a negative value was used, but that's
not new in the patch so I'm planning to leave it alone.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1992
More information about the hotspot-runtime-dev
mailing list