RFR: 8289822: G1: Make concurrent mark code owner of TAMSes [v2]

Thomas Schatzl tschatzl at openjdk.org
Thu Mar 14 19:22:38 UTC 2024


On Thu, 14 Mar 2024 17:46:46 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> The changes need to allocate `G1CollectedHeap::_is_alive_closure_cm` when creating that argument for creating the concurrent reference processor. Previously the closure used `G1CollectedHeap` which is available when inlining it into the `G1CollectedHeap` instance, but now the closure needs `G1ConcurrentMark` which is not available at that time (i.e. null).
>> The alternative would have been introducing something like an `initialize` method to that closure which I did not like.
>
> OK, could `G1CMIsAliveClosure::do_object_b` retrieve `_cm` via `_g1h`? (It's obvious why `Closure` is part of mtGC here.)

At the cost of an additional indirection per reference. I would prefer to just have an `initialize` method then.
You are right that just using `mtGC` is not appropriate here as it is used in non-GC code too. Is an `initialize` method okay with you then?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18150#discussion_r1525382122


More information about the hotspot-gc-dev mailing list