-
Notifications
You must be signed in to change notification settings - Fork 329
Remove defective atomics implementations #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
15a7caa to
0ddc010
Compare
|
@cognet What are your thoughts on this? I have nothing against it. @andreas-schwab I see s390x removed as well. This was contributed a while ago. What's the reasoning there? |
|
@sbahra I'm not opposed to the idea, I'm not sure there's much value left in having our own atomic stuff, however, the our current gcc implementation still uses the old _sync* intrinsics, which will mean full barriers everywhere, and a potentially noticeable performance impact. |
|
Not sure if it's helpful but 00000000000005d0 <gcc_atomic_faa>:
5d0: mov x2, x0
5d4: ldxr x0, [x2]
5d8: add x3, x0, x1
5dc: stxr w4, x3, [x2]
5e0: cbnz w4, 5d4 <gcc_atomic_faa+0x4>
5e4: retIt's very similar to 00000000000005f0 <ck_faa>:
5f0: ldxr x2, [x0]
5f4: add x3, x1, x2
5f8: stxr w4, x3, [x0]
5fc: cbnz w4, 5f0 <ck_faa>
600: mov x0, x2
604: retAlso interestingly on newer aarch64 CPUs with 00000000000005b0 <gcc_sync_faa>:
5b0: ldaddal x1, x0, [x0]
5b4: ret |
The AArch64, S390x and RISC-V atomic implementations are defective, remove them and replace them with the generic GCC atomic builtins. Fixes concurrencykit#247
0ddc010 to
6cc2f2a
Compare
|
@cognet Any updates on this? |
|
@sbahra I don't and at this point I'm far away from my arm64 hardware, and won't be able to work on this for a while. |
Correctness is paramount but that is probably going to be brutal for performance 😄 |
|
@cognet Would it help if I get you an AWS instance with ARM? Otherwise, I'll need to find time myself to look at this and that's been tough lately. I'd like to better understand this and then harden our tests. @andreas-schwab The issue you listed also refers to RiscV. I'm concerned about a deeper underlying issue. Is the ck_pr implementation for Risc V defective? If you use GCC intrinsics, does the issue still reproduce? |
|
@sbahra I'm honestly not sure I'll be able to have a real look before late February. |
The AArch64 and RISC-V atomic implementations are defective, remove them
and replace them with the generic GCC atomic builtins.
Fixes #247