JDK-8069273 : Decrease Hot Card Cache Lock contention
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-01-19
  • Updated: 2018-11-20
  • Resolved: 2015-01-29
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 8 JDK 9
8u60Fixed 9 b51Fixed
Description
On benchmarks with a large number of reference changes (like nosql benchmarks) on "large" machines we noticed that the HotCardCache_lock is highly contended(*).

Investigate and fix this in the hope to improve behavior.

(*) Contended as in at the time of trying to get ownership of the lock, there is already another owner of that lock.
Comments
Initial prototype introduced false sharing between _hot_cache_idx and some other fields. Introducing a padding resolved this and I can show a considerable speedup on microbenchmarks set up to torture G1HotCardCache::insert. Cleaning up further, the independently updated _idx fields were grouped and a padding was added also after to remove risk of inducing false sharing on subsequent fields. http://cr.openjdk.java.net/~redestad/8069273/webrev.00/ Pending successful tests I'll post this for review.
20-11-2018