RFR: 8316959: Improve InlineCacheBuffer pending queue management [v2]

Thomas Schatzl tschatzl at openjdk.org
Mon Oct 9 08:39:24 UTC 2023


On Fri, 6 Oct 2023 20:05:48 GMT, Dean Long <dlong at openjdk.org> wrote:

>> src/hotspot/share/code/icBuffer.cpp line 251:
>> 
>>> 249: void InlineCacheBuffer::release_pending_icholders() {
>>> 250:   assert(SafepointSynchronize::is_at_safepoint(), "should only be called during a safepoint");
>>> 251:   CompiledICHolder* holder = Atomic::xchg(&_pending_released, (CompiledICHolder*)nullptr, memory_order_relaxed);
>> 
>> I don't see why atomics are needed here.  Any GC threads calling queue_for_release() should be finished, and now we are single-threaded at a safepoint.
>
> Maybe file an RFE to do this work in parallel threads to reduce safepoint pause time?

> I don't see why atomics are needed here. Any GC threads calling queue_for_release() should be finished, and now we are single-threaded at a safepoint.

I found the `xchg` more convenient than explicitly nulling out `_pending_release` in a separate statement. The implicit atomic op for `xchg` is just incidental (and won't have any impact on performance).

Will file an rfe about making this parallel.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16059#discussion_r1350003383


More information about the hotspot-compiler-dev mailing list