JDK-8228901 : Make ClassLoaderDataGraph linked list lock free
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 14
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2019-07-31
  • Updated: 2019-09-20
  • Resolved: 2019-09-20
Related Reports
Relates :  
Relates :  
Description
It's a single linked list, so should be able to be made lock free.  This would have prevented a lot of bugs that we've seen with trying to take this lock during a safepoint by a GC thread and with safepoint locking with non-gc threads.

The reason for the lock was because performance wasn't critical, but removing it would avoid certain potential deadlocks.
Comments
After adding verification for the VMThread, it's not necessary to make ClassLoaderDataGraph lock free because deadlocks with the VM thread (and soon other non-concurrent gc threads) will be detected with the linked bug JDK-8213150. It really is simpler to have a lock protect this list. Closing as WNF.
20-09-2019