RFR: 8318986: Improve GenericWaitBarrier performance [v3]

Robbin Ehn rehn at openjdk.org
Tue Nov 7 09:16:32 UTC 2023


On Tue, 7 Nov 2023 09:05:30 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 192:
> 
>> 190:         return;
>> 191:       }
>> 192:       assert(s > 0, "Before wait: Should be armed. State: %d", s);
> 
> If we are context switched here until this cell is re-used ?
> Hence we have the wrong barrier tag ?
> 
> For safepoint this can't happen since the safepoint id for this safepoint safe thread will be wrong.
> Thus we can't re-use cells until this thread returns and change his safepoint id.
> 
> But it seems like this is what saves us, so if there was another use-case it could happen, no?

I thinking adding the barrier tag into the _state(64), so it's a 32-bit tag, and as now sign bit for armed/disarmed plus the 31-bit counter.

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

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


More information about the hotspot-dev mailing list