< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp

Print this page
rev 58558 : 8241605: Shenandoah: More aggressive reference discovery


  28 #include "gc/shenandoah/shenandoahArguments.hpp"
  29 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
  30 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  31 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
  32 #include "utilities/defaultStream.hpp"
  33 
  34 void ShenandoahArguments::initialize() {
  35 #if !(defined AARCH64 || defined AMD64 || defined IA32)
  36   vm_exit_during_initialization("Shenandoah GC is not supported on this platform.");
  37 #endif
  38 
  39 #if 0 // leave this block as stepping stone for future platforms
  40   log_warning(gc)("Shenandoah GC is not fully supported on this platform:");
  41   log_warning(gc)("  concurrent modes are not supported, only STW cycles are enabled;");
  42   log_warning(gc)("  arch-specific barrier code is not implemented, disabling barriers;");
  43 
  44   FLAG_SET_DEFAULT(ShenandoahGCHeuristics,           "passive");
  45 
  46   FLAG_SET_DEFAULT(ShenandoahSATBBarrier,            false);
  47   FLAG_SET_DEFAULT(ShenandoahLoadRefBarrier,         false);
  48   FLAG_SET_DEFAULT(ShenandoahKeepAliveBarrier,       false);
  49   FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, false);
  50   FLAG_SET_DEFAULT(ShenandoahCASBarrier,             false);
  51   FLAG_SET_DEFAULT(ShenandoahCloneBarrier,           false);
  52 
  53   FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers,     false);
  54 #endif
  55 
  56   if (UseLargePages && (MaxHeapSize / os::large_page_size()) < ShenandoahHeapRegion::MIN_NUM_REGIONS) {
  57     warning("Large pages size (" SIZE_FORMAT "K) is too large to afford page-sized regions, disabling uncommit",
  58             os::large_page_size() / K);
  59     FLAG_SET_DEFAULT(ShenandoahUncommit, false);
  60   }
  61 
  62   // Enable NUMA by default. While Shenandoah is not NUMA-aware, enabling NUMA makes
  63   // storage allocation code NUMA-aware.
  64   if (FLAG_IS_DEFAULT(UseNUMA)) {
  65     FLAG_SET_DEFAULT(UseNUMA, true);
  66   }
  67 
  68   // Set up default number of concurrent threads. We want to have cycles complete fast


 115 
 116   if (ShenandoahRegionSampling && FLAG_IS_DEFAULT(PerfDataMemorySize)) {
 117     // When sampling is enabled, max out the PerfData memory to get more
 118     // Shenandoah data in, including Matrix.
 119     FLAG_SET_DEFAULT(PerfDataMemorySize, 2048*K);
 120   }
 121 
 122 #ifdef COMPILER2
 123   // Shenandoah cares more about pause times, rather than raw throughput.
 124   if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) {
 125     FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true);
 126     if (FLAG_IS_DEFAULT(LoopStripMiningIter)) {
 127       FLAG_SET_DEFAULT(LoopStripMiningIter, 1000);
 128     }
 129   }
 130 #ifdef ASSERT
 131   // C2 barrier verification is only reliable when all default barriers are enabled
 132   if (ShenandoahVerifyOptoBarriers &&
 133           (!FLAG_IS_DEFAULT(ShenandoahSATBBarrier)            ||
 134            !FLAG_IS_DEFAULT(ShenandoahLoadRefBarrier)         ||
 135            !FLAG_IS_DEFAULT(ShenandoahKeepAliveBarrier)       ||
 136            !FLAG_IS_DEFAULT(ShenandoahStoreValEnqueueBarrier) ||
 137            !FLAG_IS_DEFAULT(ShenandoahCASBarrier)             ||
 138            !FLAG_IS_DEFAULT(ShenandoahCloneBarrier)
 139           )) {
 140     warning("Unusual barrier configuration, disabling C2 barrier verification");
 141     FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers, false);
 142   }
 143 #else
 144   guarantee(!ShenandoahVerifyOptoBarriers, "Should be disabled");
 145 #endif // ASSERT
 146 #endif // COMPILER2
 147 
 148   if (AlwaysPreTouch) {
 149     // Shenandoah handles pre-touch on its own. It does not let the
 150     // generic storage code to do the pre-touch before Shenandoah has
 151     // a chance to do it on its own.
 152     FLAG_SET_DEFAULT(AlwaysPreTouch, false);
 153     FLAG_SET_DEFAULT(ShenandoahAlwaysPreTouch, true);
 154   }
 155 




  28 #include "gc/shenandoah/shenandoahArguments.hpp"
  29 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
  30 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  31 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
  32 #include "utilities/defaultStream.hpp"
  33 
  34 void ShenandoahArguments::initialize() {
  35 #if !(defined AARCH64 || defined AMD64 || defined IA32)
  36   vm_exit_during_initialization("Shenandoah GC is not supported on this platform.");
  37 #endif
  38 
  39 #if 0 // leave this block as stepping stone for future platforms
  40   log_warning(gc)("Shenandoah GC is not fully supported on this platform:");
  41   log_warning(gc)("  concurrent modes are not supported, only STW cycles are enabled;");
  42   log_warning(gc)("  arch-specific barrier code is not implemented, disabling barriers;");
  43 
  44   FLAG_SET_DEFAULT(ShenandoahGCHeuristics,           "passive");
  45 
  46   FLAG_SET_DEFAULT(ShenandoahSATBBarrier,            false);
  47   FLAG_SET_DEFAULT(ShenandoahLoadRefBarrier,         false);

  48   FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, false);
  49   FLAG_SET_DEFAULT(ShenandoahCASBarrier,             false);
  50   FLAG_SET_DEFAULT(ShenandoahCloneBarrier,           false);
  51 
  52   FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers,     false);
  53 #endif
  54 
  55   if (UseLargePages && (MaxHeapSize / os::large_page_size()) < ShenandoahHeapRegion::MIN_NUM_REGIONS) {
  56     warning("Large pages size (" SIZE_FORMAT "K) is too large to afford page-sized regions, disabling uncommit",
  57             os::large_page_size() / K);
  58     FLAG_SET_DEFAULT(ShenandoahUncommit, false);
  59   }
  60 
  61   // Enable NUMA by default. While Shenandoah is not NUMA-aware, enabling NUMA makes
  62   // storage allocation code NUMA-aware.
  63   if (FLAG_IS_DEFAULT(UseNUMA)) {
  64     FLAG_SET_DEFAULT(UseNUMA, true);
  65   }
  66 
  67   // Set up default number of concurrent threads. We want to have cycles complete fast


 114 
 115   if (ShenandoahRegionSampling && FLAG_IS_DEFAULT(PerfDataMemorySize)) {
 116     // When sampling is enabled, max out the PerfData memory to get more
 117     // Shenandoah data in, including Matrix.
 118     FLAG_SET_DEFAULT(PerfDataMemorySize, 2048*K);
 119   }
 120 
 121 #ifdef COMPILER2
 122   // Shenandoah cares more about pause times, rather than raw throughput.
 123   if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) {
 124     FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true);
 125     if (FLAG_IS_DEFAULT(LoopStripMiningIter)) {
 126       FLAG_SET_DEFAULT(LoopStripMiningIter, 1000);
 127     }
 128   }
 129 #ifdef ASSERT
 130   // C2 barrier verification is only reliable when all default barriers are enabled
 131   if (ShenandoahVerifyOptoBarriers &&
 132           (!FLAG_IS_DEFAULT(ShenandoahSATBBarrier)            ||
 133            !FLAG_IS_DEFAULT(ShenandoahLoadRefBarrier)         ||

 134            !FLAG_IS_DEFAULT(ShenandoahStoreValEnqueueBarrier) ||
 135            !FLAG_IS_DEFAULT(ShenandoahCASBarrier)             ||
 136            !FLAG_IS_DEFAULT(ShenandoahCloneBarrier)
 137           )) {
 138     warning("Unusual barrier configuration, disabling C2 barrier verification");
 139     FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers, false);
 140   }
 141 #else
 142   guarantee(!ShenandoahVerifyOptoBarriers, "Should be disabled");
 143 #endif // ASSERT
 144 #endif // COMPILER2
 145 
 146   if (AlwaysPreTouch) {
 147     // Shenandoah handles pre-touch on its own. It does not let the
 148     // generic storage code to do the pre-touch before Shenandoah has
 149     // a chance to do it on its own.
 150     FLAG_SET_DEFAULT(AlwaysPreTouch, false);
 151     FLAG_SET_DEFAULT(ShenandoahAlwaysPreTouch, true);
 152   }
 153 


< prev index next >