RFR: 8322630: Remove ICStubs and related safepoints

Erik Österlund eosterlund at openjdk.org
Wed Jan 24 17:31:28 UTC 2024


On Tue, 23 Jan 2024 14:47:49 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> ICStubs solve an atomicity problem when setting both the destination and data of an inline cache. Unfortunately, it also leads to occasional safepoint carpets when multiple threads need to ICRefill the stubs at the same time, and spurious GuaranteedSafepointInterval "Cleanup" safepoints every second. This patch changes inline caches to not change the data part at all during the nmethod life cycle, hence removing the need for ICStubs.
>> 
>> The new scheme is less stateful. Instead of adding and removing callsite metadata back and forth when transitioning inline cache states, it installs all state any shape of call will ever need at resolution time in a struct that I call CompiledICData. This reduces inline cache state changes to simply changing the destination of the call, and it doesn't really matter what state transitions to what other state.
>> 
>> With this patch, we get rid of ICStub and ICBuffer classes and the related ICRefill and almost all Cleanup safepoints in practice. It also makes the inline cache code much simpler.
>> 
>> I have tested the changes from tier1-7, and run through full aurora performance tests.
>
> Fwiw, the change makes class unloading regress significantly in a class unloading stress test (unloading 60k classes), seemingly tripling the time it takes for the "Purge Unlinked NMethods" phase (~20ms -> ~60ms).
> 
> This may not be a problem for the concurrent gcs, but can be for the STW ones.
> 
> (Overall max G1 remark pause times went from 160ms to 220ms, regular Remark pauses which do class unloading from 120ms to 160ms).

@tschatzl what program did you run, so I can reproduce?

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

PR Comment: https://git.openjdk.org/jdk/pull/17495#issuecomment-1908602132


More information about the shenandoah-dev mailing list