RFR: 8225255: Make SATB qset lock-free
Kim Barrett
kim.barrett at oracle.com
Wed Jun 19 18:10:23 UTC 2019
Please review this refactoring of the PtrQueueSet hierarchy to allow
the elimination of the completed buffer lock for SATBMarkQueueSet.
This change moves much of the API and all of the associated
implementation for PtrQueueSet to G1DirtyCardQueueSet, pretty much
as-is. That move includes everything about the lock-based completed
buffer list. (I'm planning to work in improvements in the G1-specific
dirty card queue code too, but not as part of this changeset.)
Instead we now have a pure virtual enqueue_completed_buffer function
in PtrQueueSet.
Making the SATB queue set's completed buffer list lock-free makes the
management of the count and process_completed_buffers flag trickier.
But it might be possible to simplify things by changing the uses.
Shenandoah doesn't use process_completed_buffers at all. G1 only uses
the count directly in assertions, and indirectly in the management of
process_completed_buffers. If G1 didn't use that flag, I think the
whole count and flag management could be eliminated. That will be
looked at later; see JDK-8226337.
The is_active protocol still remains in PtrQueue and PtrQueueSet, even
though it's only used by the SATB derivation. That will be looked at
later; see JDK-8226408.
As part of this change, Shenandoah has also been updated to no longer
use the SATB completed buffer lock.
CR:
https://bugs.openjdk.java.net/browse/JDK-8225255
Webrev:
http://cr.openjdk.java.net/~kbarrett/8225255/open.00/
Testing:
mach5 tier1-5
local extended gcbasher.
Performance testing found no significant difference. That's expected,
as this change only affects the cost of adding and removing buffers
from the SATB qset. On the mutator side, buffer filtering reduces
the amount of buffer completion substantially. The purpose of this
change is not to directly improve performance, but to make later
performance improvements possible or at least easier.
More information about the hotspot-gc-dev
mailing list