RFR: 8293252: Shenandoah: ThreadMXBean synchronizer tests crash with aggressive heuristics [v2]

Ashutosh Mehra duke at openjdk.org
Thu Sep 22 19:57:23 UTC 2022


On Thu, 22 Sep 2022 18:10:45 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> I have added commit that replaces the `RawAccess` with `HeapAccess<AS_NO_KEEPALIVE>`. I think its better not to avoid the check `if (_heap->is_concurrent_weak_root_in_progress() && !_marking_context->is_marked(obj))` by using `ON_PHANTOM_OOP_REF` decorator as it relies on the assumption that weak oops in the VM are similar to phantomly reachable references (which is true and may remain so, but is not as explicit as the condition itself). I have therefore kept the check for `is_concurrent_weak_root_in_progress` as it is.
>
> It might be simpler to only change the one line in these object iterators:
> 
> obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj); 
> 
> to
> 
> obj = ShenandoahBarrierSet::load_reference_barrier(obj); 
> 
> This will evacuate objects in the cset after checking for unmarked concurrent weak roots. `resolve_forwarded_not_null` presumes the object has already been evacuated, but that may not be the case here.

I missed the fact that the object referred by week root would have already been evacuated by the time we hit `is_concurrent_weak_root_in_progress` condition.
 I think it makes sense to just call `ShenandoahBarrierSet::load_reference_barrier` directly. Thanks for pointing that out.

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

PR: https://git.openjdk.org/jdk/pull/10268



More information about the hotspot-gc-dev mailing list