RFR: 8291555: Implement alternative fast-locking scheme [v30]

Roman Kennke rkennke at openjdk.org
Thu Mar 30 14:32:05 UTC 2023


On Tue, 28 Mar 2023 02:59:31 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Ensure safepoint when processing lock-stack
>
> src/hotspot/share/runtime/objectMonitor.inline.hpp line 36:
> 
>> 34: #include "runtime/synchronizer.hpp"
>> 35: 
>> 36: inline intptr_t ObjectMonitor::is_entered(JavaThread* current) const {
> 
> Suggestion:
> 
> inline bool ObjectMonitor::is_entered(JavaThread* current) const {

Oh dear, where did that came from? I'm fixing it.

> src/hotspot/share/runtime/synchronizer.cpp line 506:
> 
>> 504:               return;
>> 505:             }
>> 506:             // Otherwise retry.
> 
> Why is retry important for the new code but not the old code?

It is not. There's the off-chance that another thread installs a hash-code (with the new locking this would be possible to do without causing inflation), but I guess that would be a very rare clash. I'm changing the code to not retry and directly dive into inflation instead.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/10907#discussion_r1153318137
PR Review Comment: https://git.openjdk.org/jdk/pull/10907#discussion_r1153320332


More information about the serviceability-dev mailing list