RFR: 8225344: Avoid VM_EnableBiasedLocking VM operation during bootstrap if BiasedLockingStartupDelay is 0

Claes Redestad claes.redestad at oracle.com
Wed Jun 26 14:33:34 UTC 2019



On 2019-06-26 16:21, Aleksey Shipilev wrote:
> On 6/26/19 3:10 PM, Claes Redestad wrote:
>> Hi,
>>
>> please review this cleanup to avoid a safepointing VM operation during
>> bootstrap to enable biased locking if the configured delay is zero
>> (current default).
>>
>> Webrev: http://cr.openjdk.java.net/~redestad/8225344/open.00/
> 
> The idea sounds fine. I wonder, however, if VM operation provided enough synchronization for every
> Java thread to see the new value of the flag. Without the VM op, it seems safer to wrap the accesess
> to that field with OrderAccess.

I don't think we need to bother with that since BiasedLocking::enabled()
will always return true if BiasedLockingStartupDelay == 0, which is the
only case where we skip/avoid the VM operation.

/Claes


More information about the hotspot-runtime-dev mailing list