RFR: 8210330: Make CLD claiming allow multiple claim bits
erik.osterlund at oracle.com
Tue Sep 4 08:42:14 UTC 2018
Today, the claim value of a CLD is logically a boolean, stored as an
int. Either a CLD is claimed, or not claimed. This is used by the GC to
see if oops_do can be skipped on the CLD, because its handles have
already been marked.
With ZGC supporting concurrent class unloading, the CLD holder can be
marked finalizably reachable first, and afterwards strongly reachable.
This requires 2 claim bits in the CLD: one for claiming it for strong
marking of the oop handles, and one for finalizable marking.
Rather than making a separate mechanism for ZGC only, I would like to
use these shared claim bits. I think this is a fascility that anyone who
has concurrent reference processing and concurrent class unloading will
need, it just happens to be that ZGC is the first GC to do that in
hotspot. I also have the hypothesis that this can be beneficial for
other uses such as the JFR leak profiler, which can have its own claim
bits, instead of clearing the claim bit, doing its thing, and then
restoring the claim bit to what it was before.
As part of this change, I changed the "must_claim" boolean that is
passed around to instead take an int for the desired claim value, and
made it explicit and not implicit.
More information about the hotspot-dev