RFR: 8276205: Shenandoah: CodeCache_lock should always be held for initializing code cache iteration

Zhengyu Gu zgu at openjdk.java.net
Mon Nov 1 15:28:24 UTC 2021


There are few bugs in current implementation:
1) No CodeCache_lock is held when initialize code cache iterator at safepoints. This is a problem for concurrent GC, since it can initialize a concurrent code cache iterator while holding CodeCache_lock without safepoint check.

2) Does not notify waiters upon completion of iteration at safepoints

3) Unnecessary held CodeCache_lock during concurrent code cache iteration.

Test:
- [x] hotspot_gc_shenandoah on Linux x86_64
- [x] hotspot_gc_shenandoah on Linux aarch64

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

Commit messages:
 - v0

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

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


More information about the hotspot-gc-dev mailing list