RFR: 8304138: [JVMCI] Test FailedSpeculation existence before appending. [v2]
Vladimir Kozlov
kvn at openjdk.org
Tue Mar 14 15:34:51 UTC 2023
On Tue, 14 Mar 2023 15:30:37 GMT, Yudi Zheng <yzheng at openjdk.org> wrote:
>> Upon uncommon_trap, JVMCI runtime appends a FailedSpeculation entry to the nmethod using an [atomic operation](https://github.com/openjdk/jdk/blob/55aa122462c34d8f4cafa58f4d1f2d900449c83e/src/hotspot/share/oops/methodData.cpp#L852). It becomes a performance bottleneck when there is a large amount of (virtual) threads deoptimizing in the nmethod. In this PR, we test if a FailedSpeculation exists in the list before appending it.
>
> Yudi Zheng has updated the pull request incrementally with one additional commit since the last revision:
>
> avoid iterating from beginning.
I agree that it is better than before.
But without some kind of lock several threads can add the same speculation data in the window between new check and adding data to the list.
src/hotspot/share/oops/methodData.cpp line 858:
> 856: guarantee_failed_speculations_alive(nm, failed_speculations_address);
> 857:
> 858: cursor = failed_speculations_address;
Why not continue from `cursor` value from previous check loop?
Can the list be modified by other threads in between?
-------------
PR: https://git.openjdk.org/jdk/pull/13022
More information about the hotspot-compiler-dev
mailing list