RFR(L): 8151601: Cleanup locking of the Reference pending list

Per Liden per.liden at oracle.com
Thu Mar 10 15:53:17 UTC 2016


Hi,

The SurrogateLockerThread is currently used by both G1 and CMS to lock 
the Reference pending list. However, there's quite a bit of unnecessary 
code duplication and special case handling in this area. This patch is 
an attempt to clean this up.

The main changes:

- All locking of the pending list is how done through the new 
ReferencePendingListLocker. This locker delegates to a locker thread if 
needed.

- The locking related code in instanceRefKlass was moved to the new 
ReferencePendingListLocker.

- What used to be the SurrogateLockerThread is now the 
ReferencePendingListLockerThread.

- The new virtual function 
CollectedHeap::needs_reference_pending_list_locker_thread() indicates if 
a collector needs a locker thread. G1 and CMS returns true here.

Bug: https://bugs.openjdk.java.net/browse/JDK-8151601
Webrev: http://cr.openjdk.java.net/~pliden/8151601/webrev.0/
Testing: jprt, vm.gc

cheers,
Per



More information about the hotspot-gc-dev mailing list