JDK-7194669 : CodeCache::mark_for_deoptimization should avoid verifying dependencies multiple times
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-08-28
  • Updated: 2023-09-28
  • Resolved: 2014-01-15
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 9
9 b03Fixed
Related Reports
Relates :  
Relates :  
Description
The dependency verification code in CodeCache::mark_for_deoptimization walks over all live nmethods in the code cache and checks all dependencies for each nmethod.  This leads to checking the same dependency multiple times which can take a huge amount of time.

Due to this fact some tests time out when running with debug builds (see JDK-7194662).  Especially tests with a lot of nmethods in the code cache.

Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/3aaa4b9966f6 User: lana Date: 2014-02-11 20:38:10 +0000
11-02-2014

URL: http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/rev/3aaa4b9966f6 User: anoll Date: 2014-01-15 06:50:44 +0000
15-01-2014

Solution: To avoid checking dependencies more than once, dependencies are abstracted by dependency signatures, which consider (i) the type of a dependency and (ii) the pointer values of the arguments of a dependency. The pointers are guaranteed to be unique if no safepoint occurs. A No_SafepointVerifier checks this assumption For each dependency that will be checked, a dependency signature is generated and that dependency signature is compared against a set of already checked dependency signatures. If a dependency has already been checked, the check is skipped. Dependency signatures of a specific type are stored a GrowableArray. I.e., each dependency type has its own GrowableArray. There is a performance difference (nashorn + octane) between using binary search and GrowableArray to lookup dependencies: The linear-search version uses one GrowableArray<DependencySignature*> for each dependency type. The difference in dependency checking time is 15-20%, i.e., binary search is 15-20% faster than linear search. However, using linear search to cache checked dependencies is still ~4X faster compared to checking all dependencies. Results: An evaluation of the performance gain shows a 4x speedup of dependency checking. More concretely, I used nashorn + octane on a 64-bit Linux Hotspot version. The dependency checking time of the original version is 3888 seconds. The dependency checking time of the optimized version is 902 seconds.
15-01-2014

No it's not. We still have this problem.
10-06-2013

This maybe fixed by now, but ask Christian
10-06-2013