RFR: 8318986: Improve GenericWaitBarrier performance

Aleksey Shipilev shade at openjdk.org
Thu Nov 2 21:00:19 UTC 2023


On Thu, 2 Nov 2023 12:50:56 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

> Regarding the bug, accounting for context switches in every 'sub-state' usually gets you at least one time. That is what the: Atomic::add(&_barrier_threads, 1);, did, "no marine left behind" :)

Yes. I think most of the race condition mess comes from juggling several counters at once, *plus* depending on `barrier_tag`. The new version fuses the important counters together and melds in the arm/disarm status into the counter. Which allows to manage things more easily but CAS-ing one counter only. I think that resolves race conditions I saw in previous implementation. It yields same performance. Now running it through functional testing.

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

PR Comment: https://git.openjdk.org/jdk/pull/16404#issuecomment-1791021354


More information about the hotspot-dev mailing list