RFR: 8286957: Held monitor count [v4]
Erik Österlund
eosterlund at openjdk.org
Tue Jul 5 13:53:46 UTC 2022
On Mon, 4 Jul 2022 11:05:26 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> The current implementation do not count all monitor enter, counts high up in abstraction and causes a performance regression on aarch64 with some benchmarks due to C2 changes.
>>
>> This change makes the counting exact by pushing the counting down in the abstraction.
>> The additional JNI counter is strictly not needed, but enables us to figure out if we have monitors "on stack".
>>
>> An uncontended lock plus unlock is 1 ns (21.5 -> 22.5) slower in C2 compiled code on x64 with the additional increment and decrement.
>>
>> Fixed aarch64, x64, x86 and zero.
>>
>> Passes t1-8
>
> Robbin Ehn has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
>
> - Merge branch 'master' into held-mon-count
> - Fixed var name
> - Merge branch 'master' into held-mon-count
> - Merge branch 'master' into held-mon-count
> - 8286957 - PR Baseline
Looks good. We might however want the counter to be 64 bit so we don't have to think about overflows. I suppose nasty JNI code could lock the entire heap and then unlock it.
-------------
Changes requested by eosterlund (Reviewer).
PR: https://git.openjdk.org/jdk/pull/8945
More information about the hotspot-dev
mailing list