RFR: 8190711: Assert in G1MMUTracker due to concurrent modification

Stefan Johansson stefan.johansson at oracle.com
Wed Nov 8 10:47:47 UTC 2017

Hi all,

Please review this fix for:


The G1MMUTracker is used both by the concurrent gc threads and during 
STW by the VM thread. Up until this change we have had modifications 
done to the internal data structure from both sides. To synchronize we 
have used the SuspendibleThreadSet but this doesn't stop two different 
concurrent threads from modifying the data at the same time. We need to 
prevent this.

The reason to update the data structure (remove entires) in the 
concurrent phase is a possible performance improvement due to having 
fewer entries to iterate when calling when_sec(). Since there can never 
be more than 64 entries, the gain, if any, is very small. We still 
remove expired entries when adding new ones, done by add_pause() during 
STW. To avoid having more than one thread doing modification of the list 
this change removes the call to remove_expired_entries() in when_sec(). 
Having the SuspendibleThreadSet will ensure the the concurrent threads 
won't access the data while the VM thread is updating it.

* Tier 1-2


More information about the hotspot-gc-dev mailing list