RFR: 8350285: Regression caused by ShenandoahLock under extreme contention
Xiaolong Peng
xpeng at openjdk.org
Wed Feb 19 20:58:06 UTC 2025
On Wed, 19 Feb 2025 17:22:59 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
>> src/hotspot/share/gc/shenandoah/shenandoahLock.cpp line 71:
>>
>>> 69: while (SafepointSynchronize::is_synchronizing() &&
>>> 70: !SafepointMechanism::local_poll_armed(java_thread)) {
>>> 71: short_sleep();
>>
>> Why not `yield_or_sleep` here?
>
> It can be `yield_or_sleep` here now, I'll rerun a test to verify, I have updated `yield_or_sleep` to reset the counter after `short_sleep`.
>
> In our test last year, we noticed Java tread may run this loop over 20k times in worse case, the older version `yields` counter won't be reset, so it is possible after safepoint some Java thread will only do `short_sleep`, which may increase allocation latency, I don't want waiting on safepoint poll impact the allocation path after safepoint.
I have update code to use yield_or_sleep here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23701#discussion_r1962201794
More information about the shenandoah-dev
mailing list