RFR: JDK-8151336: Root region scanning should be cancelled and disabled when the ConcurrentMarkThread::run_service() exits (original) (raw)

Bengt Rutisson bengt.rutisson at oracle.com
Tue Mar 15 11:55:24 UTC 2016


Hi again,

I am working on an update to this webrev. So, please hold off with reviews of the patch below.

Thanks, Bengt

On 2016-03-14 12:23, Bengt Rutisson wrote:

Hi all, Could I have a couple of reviews for this change? http://cr.openjdk.java.net/~brutisso/8151336/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8151336 The runservice() loop in ConcurrentMarkThread looks like this: while (!shouldterminate) { // wait until started is set. sleepBeforeNextCycle(); if (shouldterminate) { cm->rootregions()->cancelscan(); break; } // do all the work } If a full GC is triggered while the ConcurrentMarkThread is in "do all the work" the full GC will wait for the root region scan. But if we at the same time decide to exit the VM we will set shouldterminate to true, which will cause the while() loop to not continue and we won't get to the cancelscan call. The proposed fix moves the call to cancelscan() until after the while loop has exited. That way we will always cancel any pending root region scanning. I also introduce a hasterminated state for G1CMRootRegions to makes sure that another root region scanning can't be initialized once the CM thread has exited. This also called for a rename of cancelscan() to terminate(). Thanks, Bengt



More information about the hotspot-gc-dev mailing list