RFR: 8318986: Improve GenericWaitBarrier performance [v3]
Aleksey Shipilev
shade at openjdk.org
Tue Nov 7 09:24:31 UTC 2023
On Tue, 7 Nov 2023 08:58:27 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> Aleksey Shipilev has updated the pull request incrementally with four additional commits since the last revision:
>>
>> - Touchups
>> - More comments work
>> - Tight up the comments
>> - Rework to a single atomic counter per cell
>
> src/hotspot/share/utilities/waitBarrier_generic.cpp line 163:
>
>> 161: int s = Atomic::load_acquire(&_state);
>> 162: assert(s > 0, "Mid disarm: Should be armed. State: %d", s);
>> 163: if (Atomic::cmpxchg(&_state, s, -s) == s) {
>
> When we hit this branch we have effectively left the outer loop.
> I think it will read easier if this scope actually was outside the scope of the outer loop, no?
Oh, you mean break out here, and just do the rest outside the loop. Yes, we can do that.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16404#discussion_r1384606323
More information about the hotspot-dev
mailing list