RFR: Do not put down update-refs-in-progress flag concurrently

Aleksey Shipilev shade at redhat.com
Mon Jan 22 11:23:58 UTC 2018


http://cr.openjdk.java.net/~shade/shenandoah/no-concurrent-ur-flag/webrev.01/

There is a race with update-refs-in-progress flag handling that is reliably reproducible with
Degenerated GC patch and AllocFailureALot. On cancellation path, ShConcThread puts u-r-in-p to false
(this was added to handle partial GC failure, IIRC). But, this is enough race window for *native*
thread to skip StoreValBarrier that is sensed by ShBarrierSet::need_update_refs_barrier and then
ShBarrierSet::write_ref_array silently corrupts the heap by not fixing up from-space ptrs.

The way out is to handle it properly, at safepoint. No thread is waiting for that flag to get down,
so there is no reason at all to do this concurrently. Full GC code has to clean up the flag instead.

There is a similar but significantly more complicated patch for evac-in-progress, which is better be
separate from this.

Testing: hotspot_gc_shenandoah, Degenerate GC tests

Thanks,
-Aleksey



More information about the shenandoah-dev mailing list