RFR: 8318986: Improve GenericWaitBarrier performance [v6]

Robbin Ehn rehn at openjdk.org
Tue Nov 21 10:47:12 UTC 2023


On Tue, 21 Nov 2023 09:33:31 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> https://lore.kernel.org/all/20230910082911.3378782-10-guoren@kernel.org/
>
> Actually, I think we don't need `SpinYield` in this particular place for a few reasons:
>  1. We want to disarm as fast as possible, even if that means more contention, since we are on "leaving safepoint" path in VM thread here _and_ we want to have all new waiters to return immediately.
>  2. No other `_state` update loop yields, so this loop is effectively low priority under contention, which makes (1) even worse.
>  3. There is a sharing between `SpinYield` in `_state` CAS loop here and wakeup backoff later. Which is subtly leaking the `SpinYield` state between the phases: the aggressive backoff accrued due to `_state` contention would transfer to dealing with signaling contention.
> 
> I removed this `wait()` in new commit.

Yes, you are correct, since they are moving towards identical state, thanks!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16404#discussion_r1400381092


More information about the hotspot-dev mailing list