CRR (M): 7127706: G1: re-enable survivors during the initial-mark pause
Tony Printezis
tony.printezis at oracle.com
Tue Jan 17 23:48:16 UTC 2012
Hi all,
Can I have a couple of code reviews for this change that re-enables the
use of survivor regions during the initial-mark pause?
http://cr.openjdk.java.net/~tonyp/7127706/webrev.0/
From the CR:
We could scan the survivors as we're copying them, however this will
require more work during the initial-mark GCs (and in particular:
special-case code in the fast path).
A better approach is to let the concurrent marking threads scan the
survivors and mark everything reachable from them a) before any more
concurrent marking work is done (so that we can just mark the objects,
without needing to push them on a stack, and let the "finger" algorithm
discover them) and b) before the next GC starts (since, if we copy them,
we won't know which of the new survivors are the ones we need to scan).
This approach has the advantage that it does not require any extra work
during the initial-mark GCs and all the work is done by the concurrent
marking threads. However, it has the disadvantage that the survivor
scanning might hold up the next GC. In most cases this should not be an
issue as GCs take place at a reasonably low rate. If it does become a
problem we could consider the following:
- like when the GC locker is active, try to extend the eden to give a
bit more time to the marking threads to finish scanning the survivors
- instead of waiting for the marking threads, a GC can take over and
finish up scanning the remaining survivors (typically, we have more GC
threads than marking threads, so the overhead will be reduced)
- if we supported region pinning, we could pin all the regions that were
not scanned by the time the GC started so that the marking threads can
resume scanning them after the GC completes
Implementation notes:
I introduced the concept of a "snapshot regions" in the ConcurrentMark
which is a set of regions that need to be scanned at the start of a
concurrent cycle. Currently, these can only be survivors but maybe we
can use the same concept for something else in the future.
Tony
More information about the hotspot-gc-dev
mailing list