6816154: G1: introduce flags to enable/disable RSet updating and scanning
Summary: Introduces two flags, -XX:-/+G1EnableParallelRSetUpdating and -XX:-/+G1EnableParallelRSetScanning, to turn on/off the "band aid" fix that serializes RSet updating / scanning during GCs.
Reviewed-by: iveresov
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp Mon Mar 16 08:01:32 2009 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp Mon Mar 16 10:52:44 2009 -0400
@@ -502,14 +502,17 @@
}
if (ParallelGCThreads > 0) {
- // This is a temporary change to serialize the update and scanning
- // of remembered sets. There are some race conditions when this is
- // done in parallel and they are causing failures. When we resolve
- // said race conditions, we'll revert back to parallel remembered
- // set updating and scanning. See CRs 6677707 and 6677708.
- if (worker_i == 0) {
+ // The two flags below were introduced temporarily to serialize
+ // the updating and scanning of remembered sets. There are some
+ // race conditions when these two operations are done in parallel
+ // and they are causing failures. When we resolve said race
+ // conditions, we'll revert back to parallel remembered set
+ // updating and scanning. See CRs 6677707 and 6677708.
+ if (G1EnableParallelRSetUpdating || (worker_i == 0)) {
updateRS(worker_i);
scanNewRefsRS(oc, worker_i);
+ }
+ if (G1EnableParallelRSetScanning || (worker_i == 0)) {
scanRS(oc, worker_i);
}
} else {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp Mon Mar 16 08:01:32 2009 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp Mon Mar 16 10:52:44 2009 -0400
@@ -295,6 +295,14 @@
\
product(uintx, G1FixedSurvivorSpaceSize, 0, \
"If non-0 is the size of the G1 survivor space, " \
- "otherwise SurvivorRatio is used to determine the size")
+ "otherwise SurvivorRatio is used to determine the size") \
+ \
+ experimental(bool, G1EnableParallelRSetUpdating, false, \
+ "Enables the parallelization of remembered set updating " \
+ "during evacuation pauses") \
+ \
+ experimental(bool, G1EnableParallelRSetScanning, false, \
+ "Enables the parallelization of remembered set scanning " \
+ "during evacuation pauses")
G1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG, DECLARE_MANAGEABLE_FLAG, DECLARE_PRODUCT_RW_FLAG)