RFR: 8320317: ObjectMonitor NotRunnable is not really an optimization
Fredrik Bredberg
fbredberg at openjdk.org
Fri Jan 5 16:48:23 UTC 2024
On Fri, 22 Dec 2023 20:55:45 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> The performance on stable / reproducible performance tests increase with up to 12% on x86 based platforms if we remove ObjectMonitor::NotRunnable(). The performance decrease seen on AArch64 based macOS can be fixed by implementing SpinPause() (see: JDK-8321371).
>>
>> This PR removes ObjectMonitor::NotRunnable().
>>
>> Tested successfully on tier1-tier5.
>
> Thumbs up.
>
> If removing `NotRunnable()` resulted in worse performance on macosx-aarch64,
> that implies that the optimization "worked" for some reason on that platform
> while it did not "work" on linux-x64 or windows-x64. The perf comment in the
> JBS doesn't mention perf results for macosx-x64 one way or the other.
>
> I understand the `SpinPause()` fix (see: [JDK-8321371](https://bugs.openjdk.org/browse/JDK-8321371))
> helps macosx-aarch64, but do we understand exactly what helped
> macosx-aarch64 in `NotRunnable()`? Similarly, do we understand exactly
> what hurt linux-x64 and windows-x64 in `NotRunnable()`?
@dcubed-ojdk
> Similarly, do we understand exactly what hurt linux-x64 and windows-x64 in `NotRunnable()`?
I haven't been able to understand exactly what hurt x64 on both linux and windows. For whatever reason it doesn't seem to hurt x86 on macos. By purely looking at the `NotRunnable()` code, I'd guess that it might be the different cost of implementing `SafeFetch`, not in the JVM but in the underlying OS/CPU platform.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17050#issuecomment-1878965103
More information about the hotspot-runtime-dev
mailing list