RFR: 8267972: Inline cache cleaning is not monotonic

Erik Österlund eosterlund at openjdk.java.net
Fri Jun 4 13:08:10 UTC 2021


When inline cache cleaning of a concurrent code cache unloading cycle happens concurrent to a mutator installing values into an inline cache, the mutator has to be careful not to undo the cleaning performed by a GC thread. Otherwise the GC can clean an inline cache that points at an is_unloading() nmethod, and then the mutator installs a reference back to an is_unloading() nmethod. Then despite the GC having traversed the code cache cleaning up inline caches, we can not be certain that there are no longer inline caches pointing at is_unloading() nmethods.
The fix is relatively simple: when computing the entry for inline caches and static calls, we today check that the target nmethod is_in_use(). We have to check that it is_in_use() && !is_unloading(), to install such code pointers, for completeness.
Testing: tier1-7 tests

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

Commit messages:
 - 8267972: Inline cache cleaning is not monotonic

Changes: https://git.openjdk.java.net/jdk/pull/4361/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4361&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8267972
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4361.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4361/head:pull/4361

PR: https://git.openjdk.java.net/jdk/pull/4361


More information about the hotspot-compiler-dev mailing list