# HG changeset patch # User stefank # Date 1430744557 -7200 # Node ID a91d6c47f076b773f1cad11fe86660c4b55b996f # Parent 394471b86a836683b0f4d825f95af7535c7c0e83 8079275: Remove CollectedHeap::use_parallel_gc_threads Reviewed-by: sjohanss, kbarrett diff -r 394471b86a83 -r a91d6c47f076 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Fri May 01 10:51:00 2015 -0700 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Mon May 04 15:02:37 2015 +0200 @@ -1082,17 +1082,6 @@ bool CompactibleFreeListSpace::block_is_obj(const HeapWord* p) const { FreeChunk* fc = (FreeChunk*)p; assert(is_in_reserved(p), "Should be in space"); - // When doing a mark-sweep-compact of the CMS generation, this - // assertion may fail because prepare_for_compaction() uses - // space that is garbage to maintain information on ranges of - // live objects so that these live ranges can be moved as a whole. - // Comment out this assertion until that problem can be solved - // (i.e., that the block start calculation may look at objects - // at address below "p" in finding the object that contains "p" - // and those objects (if garbage) may have been modified to hold - // live range information. - // assert(CollectedHeap::use_parallel_gc_threads() || _bt.block_start(p) == p, - // "Should be a block boundary"); if (FreeChunk::indicatesFreeChunk(p)) return false; Klass* k = oop(p)->klass_or_null(); if (k != NULL) { diff -r 394471b86a83 -r a91d6c47f076 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Fri May 01 10:51:00 2015 -0700 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Mon May 04 15:02:37 2015 +0200 @@ -225,16 +225,12 @@ "Offset of FreeChunk::_prev within FreeChunk must match" " that of OopDesc::_klass within OopDesc"); ) - if (CollectedHeap::use_parallel_gc_threads()) { - typedef CMSParGCThreadState* CMSParGCThreadStatePtr; - _par_gc_thread_states = - NEW_C_HEAP_ARRAY(CMSParGCThreadStatePtr, ParallelGCThreads, mtGC); - for (uint i = 0; i < ParallelGCThreads; i++) { - _par_gc_thread_states[i] = new CMSParGCThreadState(cmsSpace()); - } - } else { - _par_gc_thread_states = NULL; - } + + _par_gc_thread_states = NEW_C_HEAP_ARRAY(CMSParGCThreadState*, ParallelGCThreads, mtGC); + for (uint i = 0; i < ParallelGCThreads; i++) { + _par_gc_thread_states[i] = new CMSParGCThreadState(cmsSpace()); + } + _incremental_collection_failed = false; // The "dilatation_factor" is the expansion that can occur on // account of the fact that the minimum object size in the CMS @@ -460,7 +456,6 @@ _markBitMap(0, Mutex::leaf + 1, "CMS_markBitMap_lock"), _modUnionTable((CardTableModRefBS::card_shift - LogHeapWordSize), -1 /* lock-free */, "No_lock" /* dummy */), - _modUnionClosure(&_modUnionTable), _modUnionClosurePar(&_modUnionTable), // Adjust my span to cover old (cms) gen _span(cmsGen->reserved()), @@ -2130,10 +2125,7 @@ bool registerClosure = duringMarking; - ModUnionClosure* muc = CollectedHeap::use_parallel_gc_threads() ? - &_modUnionClosurePar - : &_modUnionClosure; - _cmsGen->gc_prologue_work(full, registerClosure, muc); + _cmsGen->gc_prologue_work(full, registerClosure, &_modUnionClosurePar); if (!full) { stats().record_gc0_begin(); @@ -3006,7 +2998,7 @@ { COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact;) - if (CMSParallelInitialMarkEnabled && CollectedHeap::use_parallel_gc_threads()) { + if (CMSParallelInitialMarkEnabled) { // The parallel version. FlexibleWorkGang* workers = gch->workers(); assert(workers != NULL, "Need parallel worker threads."); @@ -4348,7 +4340,7 @@ // dirtied since the first checkpoint in this GC cycle and prior to // the most recent young generation GC, minus those cleaned up by the // concurrent precleaning. - if (CMSParallelRemarkEnabled && CollectedHeap::use_parallel_gc_threads()) { + if (CMSParallelRemarkEnabled) { GCTraceTime t("Rescan (parallel) ", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id()); do_remark_parallel(); } else { diff -r 394471b86a83 -r a91d6c47f076 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp Fri May 01 10:51:00 2015 -0700 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp Mon May 04 15:02:37 2015 +0200 @@ -647,7 +647,6 @@ // Keep this textually after _markBitMap and _span; c'tor dependency. ConcurrentMarkSweepThread* _cmsThread; // The thread doing the work - ModUnionClosure _modUnionClosure; ModUnionClosurePar _modUnionClosurePar; // CMS abstract state machine diff -r 394471b86a83 -r a91d6c47f076 hotspot/src/share/vm/gc_interface/collectedHeap.hpp --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp Fri May 01 10:51:00 2015 -0700 +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp Mon May 04 15:02:37 2015 +0200 @@ -598,13 +598,6 @@ #endif public: - // This is a convenience method that is used in cases where - // the actual number of GC worker threads is not pertinent but - // only whether there more than 0. Use of this method helps - // reduce the occurrence of ParallelGCThreads to uses where the - // actual number may be germane. - static bool use_parallel_gc_threads() { return ParallelGCThreads > 0; } - // Copy the current allocation context statistics for the specified contexts. // For each context in contexts, set the corresponding entries in the totals // and accuracy arrays to the current values held by the statistics. Each diff -r 394471b86a83 -r a91d6c47f076 hotspot/src/share/vm/memory/genCollectedHeap.cpp --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp Fri May 01 10:51:00 2015 -0700 +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp Mon May 04 15:02:37 2015 +0200 @@ -640,7 +640,7 @@ // All threads execute the following. A specific chunk of buckets // from the StringTable are the individual tasks. if (weak_roots != NULL) { - if (CollectedHeap::use_parallel_gc_threads()) { + if (is_par) { StringTable::possibly_parallel_oops_do(weak_roots); } else { StringTable::oops_do(weak_roots);