CompareAndSet fails intermittently for riscv

wangyadong (E) yadonn.wang at huawei.com
Tue Aug 16 06:34:16 UTC 2022


> These tests fail on WeakCompareAndSet* methods.
> https://bugs.openjdk.org/browse/JDK-8292360

Yes, we know about these test failures, and we've found that these failures also occur on our "powerful" aarch64 servers.
I think there is some uncertainty about the test itself, and the probability of passing increased when you raise the test parameter of "weakAttempts".
More barriers won't work 100%, unless you try again the loop after sc fails, using the "strong" version of cas.

> Failures happen more often on slower hardware.
I guess it's the same on the aarch64 platform, but I don't have the aarch64 hardware that's as slow as current risc-v hardware.
And I found "weakAttempts" was first introduced by Aleksey because PPC reported the failures, see https://bugs.openjdk.org/browse/JDK-8155739.
We now run the weak-cas tests with a high "weakAttempts" on unmatched.

-----Original Message-----
From: riscv-port-dev [mailto:riscv-port-dev-retn at openjdk.org] On Behalf Of Vladimir Kempik
Sent: Monday, August 15, 2022 6:29 PM
To: riscv-port-dev at openjdk.org
Subject: CompareAndSet fails intermittently for riscv

Hello
Wanted to let you know I have observed some tests to fail on jdk19/20 with risc-v.
These tests fail on WeakCompareAndSet* methods.
https://bugs.openjdk.org/browse/JDK-8292360
Failures happen more often on slower hardware.
We might be missing some barrier in risc-v port.
Regards, Vladimir.


More information about the riscv-port-dev mailing list