JDK-8316959 : Improve InlineCacheBuffer pending queue management
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-09-26
  • Updated: 2024-04-19
  • Resolved: 2023-10-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21 JDK 22
21.0.4-oracleFixed 22 b20Fixed
Related Reports
Relates :  
Description
During class unloading pending ICBuffer elements are put into a global pending queue to be released during a cleanup safepoint at some point later.

This is a simple linked list which is protected by the global InlineCacheBuffer_lock.

During code cache cleaning obtaining the lock is responsible for ~40% of total time clearing the ic callsites when unlinking is done in parallel (e.g. in G1, Shenandoah).

(Clearing ic callsites is the largest contributor of time spent even after the change)

A simple solution for this problem is to make the enqueuing lock free as cleaning the list is always done in the separate Cleanup safepoint.
Comments
Fix request [21u] I backport this for parity with 21.0.4-oracle. Medium risk, change to central component. Should be well tested by any code doing class unloading. A step in resolving class unloading regression. As 21 is the latest LTS, we should go along I think. Clean backport. SAP nightly testing passed.
06-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/453 Date: 2024-04-05 07:30:21 +0000
05-04-2024

Changeset: c9985720 Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2023-10-17 19:00:51 +0000 URL: https://git.openjdk.org/jdk/commit/c9985720b91cf6ad2938e9be12da08c5193f83af
17-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16059 Date: 2023-10-05 15:43:07 +0000
06-10-2023

E.g. cleaning ~40000 nmethods takes ~176ms to obtain the lock, and the CompiledMethod::clear_ic_callsites() takes ~418ms in total (when cleaning is done by 16 threads)
26-09-2023