RFR: Fold Partial GC into Traversal GC

Roman Kennke rkennke at redhat.com
Thu Apr 26 20:00:38 UTC 2018


Hi Aleksey,

I fixed the bug that the mxbean tests triggered.

The issue was that degen would not pick up root scanning when
cancelation happens before we get there. I changed it such that
root-region-scanning can be canceled anywhere, and final-traversal would
pick it up where it's left. I also wanted to interleave it in the normal
traversal loop, but it failed. I don't know yet, why.

I also implemented the indirect matrix bookkeeping when an object's
metadata dependencies are traversed. Before, when this happened:

p -> metadata -> obj

we would ignore it, based on the observation that the incoming ptr is
outside the heap. Now we also record the base object (p), and when we
see an off-heap ptr, we record p -> obj instead of metadata-> obj. This
allows us to do class unloading in every cycle, even the partial ones!

This does pass all hotspot_gc_shenandoah tests fastdebug/release now.

Differential:
http://cr.openjdk.java.net/~rkennke/partial-traversal/webrev.05.diff/
Full:
http://cr.openjdk.java.net/~rkennke/partial-traversal/webrev.05/

Good?

Thanks,
Roman


>>> *) Is the move of ShenandoahHeapRegionSetIterator::ShenandoahHeapRegionSetIterator from .inline.hpp
>>> to .cpp sensible? This desyncs backports...
>>
>> Want me to extract this, and push separately? It did not build on 'my'
>> aarch64 box, due to missing inline (tried to compile one definition per
>> call-site, clashed in linking).
> 
> Yes, please push this under the separate changeset, so it can go to backports.
> 
>> Differential:
>> http://cr.openjdk.java.net/~rkennke/partial-traversal/webrev.04.diff/
>> Full:
>> http://cr.openjdk.java.net/~rkennke/partial-traversal/webrev.04/
>>
>> Good now?
> 
> Looks good.
> 
> I have another question, in ShenandoahTraversalGC::process_oop:
> 
>   43     // We need to check is_in_reserved() because this may be called by Metadata traversal.
>   44     bool update_matrix = _heap->is_in_reserved(p);
>   ...
>   67     if (UPDATE_MATRIX && update_matrix) {
>   68       // Successful update of reference. Also update matrix.
>   69       shenandoah_assert_not_forwarded_except(p, obj, _heap->cancelled_concgc());
>   70       _matrix->set_connected(p, obj);
>   71     }
> 
> How's that is_in_reserved correct? It will try to connect the off-heap root to in-heap oop, and then
> we do the store somewhere off the matrix. I guess that never happens during normal cycle, because
> roots would not contain forwarded objects, but it is plausible on DEGEN path? Should be is_in()?
> 
> Thanks,
> -Aleksey
> 




More information about the shenandoah-dev mailing list