RFR: 8316961: Fallback implementations for 64-bit Atomic::{add,xchg} on 32-bit platforms [v4]

Kim Barrett kbarrett at openjdk.org
Tue Oct 24 00:05:28 UTC 2023


On Mon, 23 Oct 2023 14:17:58 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> See the bug for rationale. Looks like there is enough infrastructure to achieve what we want without significant fan-out. I checked all `atomic_*.hpp` headers for unimplemented `PlatformAdd<8>` and `PlatformXchg<8>`, and only these seem to be affected.
>> 
>> Unfortunately, we cannot test these apart from the existing gtest.
>> 
>> Additional testing:
>>  - [x] linux-x86-server-fastdebug, atomic tests pass
>>  - [x] linux-arm-server-fastdebug, atomic tests pass (with #16269 applied)
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use public methods instead of Platform*

Do I understand correctly that all platforms support cas64 other than arm32,
and even it does so if using a non-ancient hardware version or the kernel
helper?  If so, I'd be inclined to just say it must always be supported and be
done with the supports_cx8 stuff around the Atomic class. So update the
comments for Atomic accordingly, and remove the supports_cx8 checks in the
tests.  But I'm okay with the current version and leaving that for followup.

Regarding the comment "inconsistency" for Atomic, I read those as being a
general comment about 64bit operations not necessarily being supported, but
that cas64 is an exception and must be supported.  I'm guessing we didn't do
what's in this PR and provide cas64-based implementations of other operations
due to also needing load64/store64, though I suppose one could even implement
those with cas64, horrid as that might be.  The templatizing effort just
maintained the status quo in this regard.

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

Marked as reviewed by kbarrett (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16252#pullrequestreview-1693730500


More information about the hotspot-dev mailing list