[master] RFR: OMWorld: Spin Changes [v2]
Coleen Phillimore
coleenp at openjdk.org
Tue May 28 14:21:17 UTC 2024
On Fri, 24 May 2024 18:02:08 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Axel Boldt-Christmas has updated the pull request incrementally with three additional commits since the last revision:
>>
>> - Cancel spinning early in case of inflation
>> - Renamed first_time variable
>> - Extract fast_lock_spin_enter
>
> src/hotspot/share/runtime/lightweightSynchronizer.cpp line 684:
>
>> 682: while (true) {
>> 683: // Fast-locking does not use the 'lock' argument.
>> 684: if (fast_lock_spin_enter(obj(), current, observed_deflation)) {
>
> So here the lock_stack doesn't contain the object but we're trying to spin in order to stall creating or fetching an ObjectMonitor for this lock. Is that right? Can you say why this is. It seems to spin before testing whether it can get the lock. Is that because the caller already tried and found the object locked?
>
> The first_time => observed_deflation rename is good. That helps a lot because reading this, you don't expect to have to wait.
Can you add the comment that says why we spin here, ie. to stall so we can avoid creating an object monitor?
> src/hotspot/share/runtime/lightweightSynchronizer.cpp line 698:
>
>> 696: }
>> 697:
>> 698: observed_deflation = true;
>
> I see now. Can you comment that if inflate_and_enter fails, it means that deflation was observed is why?
s/responisble/responsible/ typo
-------------
PR Review Comment: https://git.openjdk.org/lilliput/pull/177#discussion_r1617330993
PR Review Comment: https://git.openjdk.org/lilliput/pull/177#discussion_r1617326505
More information about the lilliput-dev
mailing list