RFR: 8321371: SpinPause() not implemented for bsd_aarch64/macOS

Fredrik Bredberg fbredberg at openjdk.org
Fri Dec 15 11:01:40 UTC 2023


On Thu, 14 Dec 2023 14:28:02 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:

>> I understand. Here the discussion went something like this:
>> 
>> The BSD port is almost strictly a MacOSX port. The configurability is more costly on MacOSX, because of the need to call os::current_thread_enable_wx().
>> 
>> The vast majority of MacOSX users don't want to configure which SpinPause instruction to use, they want something that is good straight out of the box.
>> 
>> Since there is a dedicated instruction (yield) in the AArch64 for this use case, we ought to use it. Because it's in the interest of the CPU vendor to have as good yield implementation as possible for each and every variety of the CPU. So if the user upgrades to a new CPU version, the SpinPause should still perform as good as possible, without the need to reconfigure.
>> 
>> For more info about the WX stuff, see here:
>> https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon
>
> @fbredber 
> I think what we have here is the XY problem. Please help me to understand what a problem you are trying to solve.

@eastig
> I think what we have here is the XY problem. Please help me to understand what a problem you are trying to solve.

I'd like to have a `SpinPause()` implementation in place for AArch64 based MacOSX platforms when I integrate https://github.com/openjdk/jdk/pull/17050, which removes `ObjectMonitor::NotRunnable()`.

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

PR Comment: https://git.openjdk.org/jdk/pull/16994#issuecomment-1857687292


More information about the hotspot-runtime-dev mailing list