From a385f3a4c6975317d396ea028bedd462d7864555 Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Fri, 3 Apr 2020 15:06:08 +0200 Subject: [PATCH] 8242082: Shenandoah: Purge Traversal mode Reviewed-by: shade --- .../shenandoahBarrierSetAssembler_x86.cpp | 4 +- src/hotspot/share/gc/shared/gcCause.cpp | 3 - src/hotspot/share/gc/shared/gcCause.hpp | 1 - .../shenandoah/c1/shenandoahBarrierSetC1.cpp | 7 +- .../shenandoah/c2/shenandoahBarrierSetC2.cpp | 3 +- ...henandoahTraversalAggressiveHeuristics.cpp | 130 -- ...henandoahTraversalAggressiveHeuristics.hpp | 51 - .../shenandoahTraversalHeuristics.cpp | 257 ---- .../shenandoahTraversalHeuristics.hpp | 52 - .../share/gc/shenandoah/shenandoahAsserts.cpp | 4 - .../gc/shenandoah/shenandoahBarrierSet.cpp | 8 +- .../shenandoahBarrierSet.inline.hpp | 6 +- .../shenandoahBarrierSetClone.inline.hpp | 4 - .../gc/shenandoah/shenandoahClosures.hpp | 14 - .../shenandoah/shenandoahClosures.inline.hpp | 28 +- .../shenandoah/shenandoahConcurrentMark.hpp | 1 - .../shenandoahConcurrentMark.inline.hpp | 2 +- .../shenandoah/shenandoahConcurrentRoots.cpp | 6 +- .../gc/shenandoah/shenandoahControlThread.cpp | 35 +- .../gc/shenandoah/shenandoahControlThread.hpp | 2 - .../share/gc/shenandoah/shenandoahFreeSet.cpp | 12 - .../share/gc/shenandoah/shenandoahHeap.cpp | 192 +-- .../share/gc/shenandoah/shenandoahHeap.hpp | 24 - .../gc/shenandoah/shenandoahHeap.inline.hpp | 7 +- .../gc/shenandoah/shenandoahHeapRegion.cpp | 15 - .../gc/shenandoah/shenandoahHeapRegion.hpp | 25 - .../shenandoahHeapRegion.inline.hpp | 5 - .../shenandoahHeapRegionCounters.cpp | 1 - .../shenandoahHeapRegionCounters.hpp | 1 - .../gc/shenandoah/shenandoahMarkCompact.cpp | 7 - .../gc/shenandoah/shenandoahOopClosures.hpp | 156 --- .../shenandoahOopClosures.inline.hpp | 6 - .../share/gc/shenandoah/shenandoahPacer.cpp | 27 - .../share/gc/shenandoah/shenandoahPacer.hpp | 1 - .../gc/shenandoah/shenandoahPhaseTimings.cpp | 3 - .../gc/shenandoah/shenandoahPhaseTimings.hpp | 19 - .../shenandoahRootProcessor.inline.hpp | 12 +- .../gc/shenandoah/shenandoahTraversalGC.cpp | 1113 ----------------- .../gc/shenandoah/shenandoahTraversalGC.hpp | 74 -- .../shenandoahTraversalGC.inline.hpp | 84 -- .../gc/shenandoah/shenandoahTraversalMode.cpp | 59 - .../gc/shenandoah/shenandoahTraversalMode.hpp | 37 - .../share/gc/shenandoah/shenandoahUtils.cpp | 3 - .../share/gc/shenandoah/shenandoahUtils.hpp | 2 - .../gc/shenandoah/shenandoahVMOperations.cpp | 10 - .../gc/shenandoah/shenandoahVMOperations.hpp | 18 - .../gc/shenandoah/shenandoahVerifier.cpp | 24 - .../gc/shenandoah/shenandoahVerifier.hpp | 2 - .../gc/shenandoah/shenandoahWorkerPolicy.cpp | 22 - .../gc/shenandoah/shenandoahWorkerPolicy.hpp | 8 - .../gc/shenandoah/shenandoah_globals.hpp | 1 - src/hotspot/share/runtime/vmOperations.hpp | 2 - .../compiler/c2/aarch64/TestVolatiles.java | 18 +- test/hotspot/jtreg/gc/CriticalNativeArgs.java | 2 - .../TestAllocHumongousFragment.java | 36 - .../gc/shenandoah/TestAllocIntArrays.java | 40 - .../gc/shenandoah/TestAllocObjectArrays.java | 40 - .../jtreg/gc/shenandoah/TestAllocObjects.java | 45 - .../gc/shenandoah/TestGCThreadGroups.java | 19 - .../jtreg/gc/shenandoah/TestHeapUncommit.java | 20 - .../jtreg/gc/shenandoah/TestLotsOfCycles.java | 28 - .../gc/shenandoah/TestObjItrWithHeapDump.java | 1 - .../jtreg/gc/shenandoah/TestPeriodicGC.java | 30 - .../gc/shenandoah/TestRefprocSanity.java | 20 - .../gc/shenandoah/TestRegionSampling.java | 14 - .../gc/shenandoah/TestRetainObjects.java | 30 - .../jtreg/gc/shenandoah/TestSieveObjects.java | 30 - .../jtreg/gc/shenandoah/TestStringDedup.java | 19 - .../gc/shenandoah/TestStringDedupStress.java | 32 - .../shenandoah/TestStringInternCleanup.java | 21 - .../gc/shenandoah/TestVerifyJCStress.java | 14 - .../gc/shenandoah/TestWrongArrayMember.java | 1 - .../mxbeans/TestChurnNotifications.java | 16 - .../mxbeans/TestPauseNotifications.java | 15 - .../shenandoah/oom/TestClassLoaderLeak.java | 1 - .../gc/shenandoah/options/TestExplicitGC.java | 38 - .../options/TestHeuristicsUnlock.java | 2 - .../options/TestSelectiveBarrierFlags.java | 2 +- .../options/TestWrongBarrierDisable.java | 8 - .../jtreg/gc/stress/CriticalNativeStress.java | 2 - .../gcbasher/TestGCBasherWithShenandoah.java | 43 - .../stress/gcold/TestGCOldWithShenandoah.java | 32 - .../systemgc/TestSystemGCWithShenandoah.java | 15 - 83 files changed, 30 insertions(+), 3194 deletions(-) delete mode 100644 src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.cpp delete mode 100644 src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.hpp delete mode 100644 src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalHeuristics.cpp delete mode 100644 src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp delete mode 100644 src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp delete mode 100644 src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.hpp delete mode 100644 src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.inline.hpp delete mode 100644 src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.cpp delete mode 100644 src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.hpp diff --git a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp index 5fcfe39445..f0116cb40b 100644 --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp @@ -156,7 +156,7 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_pre(MacroAssembler* masm, Address buffer(thread, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_buffer_offset())); Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset())); - __ testb(gc_state, ShenandoahHeap::MARKING | ShenandoahHeap::TRAVERSAL); + __ testb(gc_state, ShenandoahHeap::MARKING); __ jcc(Assembler::zero, done); // Do we need to load the previous value? @@ -891,7 +891,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss // Is SATB still active? Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset())); - __ testb(gc_state, ShenandoahHeap::MARKING | ShenandoahHeap::TRAVERSAL); + __ testb(gc_state, ShenandoahHeap::MARKING); __ jcc(Assembler::zero, done); // Can we store original value in the thread's buffer? diff --git a/src/hotspot/share/gc/shared/gcCause.cpp b/src/hotspot/share/gc/shared/gcCause.cpp index a8ab99b0ef..c1a5e75d41 100644 --- a/src/hotspot/share/gc/shared/gcCause.cpp +++ b/src/hotspot/share/gc/shared/gcCause.cpp @@ -108,9 +108,6 @@ const char* GCCause::to_string(GCCause::Cause cause) { case _shenandoah_concurrent_gc: return "Concurrent GC"; - case _shenandoah_traversal_gc: - return "Traversal GC"; - case _shenandoah_upgrade_to_full_gc: return "Upgrade To Full GC"; diff --git a/src/hotspot/share/gc/shared/gcCause.hpp b/src/hotspot/share/gc/shared/gcCause.hpp index 2a50d7f1f1..7b233232ba 100644 --- a/src/hotspot/share/gc/shared/gcCause.hpp +++ b/src/hotspot/share/gc/shared/gcCause.hpp @@ -78,7 +78,6 @@ class GCCause : public AllStatic { _shenandoah_stop_vm, _shenandoah_allocation_failure_evac, _shenandoah_concurrent_gc, - _shenandoah_traversal_gc, _shenandoah_upgrade_to_full_gc, _z_timer, diff --git a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp index 1ad4f6e222..7ac5a495da 100644 --- a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp +++ b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp @@ -134,9 +134,7 @@ LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, L // Read and check the gc-state-flag. LIR_Opr flag_val = gen->new_register(T_INT); __ load(active_flag_addr, flag_val); - LIR_Opr mask = LIR_OprFact::intConst(ShenandoahHeap::HAS_FORWARDED | - ShenandoahHeap::EVACUATION | - ShenandoahHeap::TRAVERSAL); + LIR_Opr mask = LIR_OprFact::intConst(ShenandoahHeap::HAS_FORWARDED); LIR_Opr mask_reg = gen->new_register(T_INT); __ move(mask, mask_reg); @@ -224,8 +222,7 @@ void ShenandoahBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0; bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0; bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode(); - bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0 || is_traversal_mode; + bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0; if ((is_weak || is_phantom || is_anonymous) && keep_alive) { // Register the value in the referent field with the pre-barrier diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp index f4bd314303..decc7a4e15 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp @@ -565,8 +565,7 @@ Node* ShenandoahBarrierSetC2::load_at_resolved(C2Access& access, const Type* val bool unknown = (decorators & ON_UNKNOWN_OOP_REF) != 0; bool on_weak_ref = (decorators & (ON_WEAK_OOP_REF | ON_PHANTOM_OOP_REF)) != 0; - bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode(); - bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0 || is_traversal_mode; + bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0; // If we are reading the value of the referent field of a Reference // object (either by using Unsafe directly or through reflection) diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.cpp deleted file mode 100644 index 400305fa46..0000000000 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" - -#include "gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.hpp" -#include "gc/shenandoah/shenandoahCollectionSet.hpp" -#include "gc/shenandoah/shenandoahFreeSet.hpp" -#include "gc/shenandoah/shenandoahHeap.inline.hpp" -#include "gc/shenandoah/shenandoahHeuristics.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" -#include "logging/log.hpp" -#include "logging/logTag.hpp" -#include "utilities/quickSort.hpp" - -ShenandoahTraversalAggressiveHeuristics::ShenandoahTraversalAggressiveHeuristics() : ShenandoahHeuristics(), - _last_cset_select(0) { - // Do not shortcut evacuation - SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahImmediateThreshold, 100); - - // Aggressive runs with max speed for allocation, to capture races against mutator - SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahPacing); - - // Aggressive evacuates everything, so it needs as much evac space as it can get - SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahEvacReserveOverflow); - - // If class unloading is globally enabled, aggressive does unloading even with - // concurrent cycles. - if (ClassUnloading) { - SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahUnloadClassesFrequency, 1); - } - -} - -bool ShenandoahTraversalAggressiveHeuristics::is_experimental() { - return false; -} - -bool ShenandoahTraversalAggressiveHeuristics::is_diagnostic() { - return true; -} - -const char* ShenandoahTraversalAggressiveHeuristics::name() { - return "traversal-aggressive"; -} - -void ShenandoahTraversalAggressiveHeuristics::choose_collection_set(ShenandoahCollectionSet* collection_set) { - ShenandoahHeap* heap = ShenandoahHeap::heap(); - - ShenandoahTraversalGC* traversal_gc = heap->traversal_gc(); - - ShenandoahHeapRegionSet* traversal_set = traversal_gc->traversal_set(); - traversal_set->clear(); - - RegionData *data = get_region_data_cache(heap->num_regions()); - size_t cnt = 0; - - // About to choose the collection set, make sure we have pinned regions in correct state - heap->assert_pinned_region_status(); - - // Step 0. Prepare all regions - for (size_t i = 0; i < heap->num_regions(); i++) { - ShenandoahHeapRegion* r = heap->get_region(i); - if (r->used() > 0) { - if (r->is_regular()) { - data[cnt]._region = r; - data[cnt]._garbage = r->garbage(); - data[cnt]._seqnum_last_alloc = r->seqnum_last_alloc_mutator(); - cnt++; - } - traversal_set->add_region(r); - } - } - - for (size_t i = 0; i < cnt; i++) { - if (data[i]._seqnum_last_alloc > _last_cset_select) continue; - - ShenandoahHeapRegion* r = data[i]._region; - assert (r->is_regular(), "should have been filtered before"); - - if (r->garbage() > 0) { - assert(!collection_set->is_in(r), "must not yet be in cset"); - collection_set->add_region(r); - } - } - - // Clear liveness data - // TODO: Merge it with step 0, but save live data in RegionData before. - for (size_t i = 0; i < heap->num_regions(); i++) { - ShenandoahHeapRegion* r = heap->get_region(i); - if (r->used() > 0) { - r->clear_live_data(); - } - } - - collection_set->update_region_status(); - - _last_cset_select = ShenandoahHeapRegion::seqnum_current_alloc(); -} - -void ShenandoahTraversalAggressiveHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* set, - RegionData* data, size_t data_size, - size_t free) { - ShouldNotReachHere(); -} - -bool ShenandoahTraversalAggressiveHeuristics::should_start_gc() const { - log_info(gc)("Trigger: Start next cycle immediately"); - return true; -} diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.hpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.hpp deleted file mode 100644 index 9e9837c77e..0000000000 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2019, Red Hat, Inc. All rights reserved. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALAGGRESSIVEHEURISTICS_HPP -#define SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALAGGRESSIVEHEURISTICS_HPP - -#include "gc/shenandoah/shenandoahHeuristics.hpp" - -class ShenandoahTraversalAggressiveHeuristics : public ShenandoahHeuristics { -private: - uint64_t _last_cset_select; - -protected: - virtual void choose_collection_set_from_regiondata(ShenandoahCollectionSet* set, - RegionData* data, size_t data_size, - size_t free); - -public: - ShenandoahTraversalAggressiveHeuristics(); - - virtual bool is_experimental(); - - virtual bool is_diagnostic(); - - virtual const char* name(); - - virtual void choose_collection_set(ShenandoahCollectionSet* collection_set); - virtual bool should_start_gc() const; -}; - -#endif // SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALAGGRESSIVEHEURISTICS_HPP diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalHeuristics.cpp deleted file mode 100644 index dbf4cd3d94..0000000000 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalHeuristics.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" - -#include "gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp" -#include "gc/shenandoah/shenandoahCollectionSet.hpp" -#include "gc/shenandoah/shenandoahFreeSet.hpp" -#include "gc/shenandoah/shenandoahHeap.inline.hpp" -#include "gc/shenandoah/shenandoahHeuristics.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" -#include "logging/log.hpp" -#include "logging/logTag.hpp" -#include "utilities/quickSort.hpp" - -ShenandoahTraversalHeuristics::ShenandoahTraversalHeuristics() : ShenandoahHeuristics(), - _last_cset_select(0) {} - -bool ShenandoahTraversalHeuristics::is_experimental() { - return false; -} - -bool ShenandoahTraversalHeuristics::is_diagnostic() { - return false; -} - -const char* ShenandoahTraversalHeuristics::name() { - return "traversal"; -} - -void ShenandoahTraversalHeuristics::choose_collection_set(ShenandoahCollectionSet* collection_set) { - ShenandoahHeap* heap = ShenandoahHeap::heap(); - - ShenandoahTraversalGC* traversal_gc = heap->traversal_gc(); - - ShenandoahHeapRegionSet* traversal_set = traversal_gc->traversal_set(); - traversal_set->clear(); - - RegionData *data = get_region_data_cache(heap->num_regions()); - size_t cnt = 0; - - // About to choose the collection set, make sure we have pinned regions in correct state - heap->assert_pinned_region_status(); - - // Step 0. Prepare all regions - - for (size_t i = 0; i < heap->num_regions(); i++) { - ShenandoahHeapRegion* r = heap->get_region(i); - if (r->used() > 0) { - if (r->is_regular()) { - data[cnt]._region = r; - data[cnt]._garbage = r->garbage(); - data[cnt]._seqnum_last_alloc = r->seqnum_last_alloc_mutator(); - cnt++; - } - traversal_set->add_region(r); - } - } - - // The logic for cset selection is similar to that of adaptive: - // - // 1. We cannot get cset larger than available free space. Otherwise we guarantee OOME - // during evacuation, and thus guarantee full GC. In practice, we also want to let - // application to allocate something. This is why we limit CSet to some fraction of - // available space. In non-overloaded heap, max_cset would contain all plausible candidates - // over garbage threshold. - // - // 2. We should not get cset too low so that free threshold would not be met right - // after the cycle. Otherwise we get back-to-back cycles for no reason if heap is - // too fragmented. In non-overloaded non-fragmented heap min_garbage would be around zero. - // - // Therefore, we start by sorting the regions by garbage. Then we unconditionally add the best candidates - // before we meet min_garbage. Then we add all candidates that fit with a garbage threshold before - // we hit max_cset. When max_cset is hit, we terminate the cset selection. Note that in this scheme, - // ShenandoahGarbageThreshold is the soft threshold which would be ignored until min_garbage is hit. - // - // The significant complication is that liveness data was collected at the previous cycle, and only - // for those regions that were allocated before previous cycle started. - - size_t capacity = heap->max_capacity(); - size_t actual_free = heap->free_set()->available(); - - size_t max_cset = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste); - size_t free_target = (capacity / 100 * ShenandoahMinFreeThreshold) + max_cset; - size_t min_garbage = free_target > actual_free ? (free_target - actual_free) : 0; - - log_info(gc, ergo)("Adaptive CSet Selection. Target Free: " SIZE_FORMAT "%s, Actual Free: " - SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s, Min Garbage: " SIZE_FORMAT "%s", - byte_size_in_proper_unit(free_target), proper_unit_for_byte_size(free_target), - byte_size_in_proper_unit(actual_free), proper_unit_for_byte_size(actual_free), - byte_size_in_proper_unit(max_cset), proper_unit_for_byte_size(max_cset), - byte_size_in_proper_unit(min_garbage), proper_unit_for_byte_size(min_garbage)); - - // Better select garbage-first regions, and then older ones - QuickSort::sort(data, (int) cnt, compare_by_garbage_then_alloc_seq_ascending, false); - - size_t cur_cset = 0; - size_t cur_garbage = 0; - - size_t garbage_threshold = ShenandoahHeapRegion::region_size_bytes() / 100 * ShenandoahGarbageThreshold; - - // Step 1. Add trustworthy regions to collection set. - // - // We can trust live/garbage data from regions that were fully traversed during - // previous cycle. Even if actual liveness is different now, we can only have _less_ - // live objects, because dead objects are not resurrected. Which means we can undershoot - // the collection set, but not overshoot it. - - for (size_t i = 0; i < cnt; i++) { - if (data[i]._seqnum_last_alloc > _last_cset_select) continue; - - ShenandoahHeapRegion* r = data[i]._region; - assert (r->is_regular(), "should have been filtered before"); - - size_t new_garbage = cur_garbage + r->garbage(); - size_t new_cset = cur_cset + r->get_live_data_bytes(); - - if (new_cset > max_cset) { - break; - } - - if ((new_garbage < min_garbage) || (r->garbage() > garbage_threshold)) { - assert(!collection_set->is_in(r), "must not yet be in cset"); - collection_set->add_region(r); - cur_cset = new_cset; - cur_garbage = new_garbage; - } - } - - // Step 2. Try to catch some recently allocated regions for evacuation ride. - // - // Pessimistically assume we are going to evacuate the entire region. While this - // is very pessimistic and in most cases undershoots the collection set when regions - // are mostly dead, it also provides more safety against running into allocation - // failure when newly allocated regions are fully live. - - for (size_t i = 0; i < cnt; i++) { - if (data[i]._seqnum_last_alloc <= _last_cset_select) continue; - - ShenandoahHeapRegion* r = data[i]._region; - assert (r->is_regular(), "should have been filtered before"); - - // size_t new_garbage = cur_garbage + 0; (implied) - size_t new_cset = cur_cset + r->used(); - - if (new_cset > max_cset) { - break; - } - - assert(!collection_set->is_in(r), "must not yet be in cset"); - collection_set->add_region(r); - cur_cset = new_cset; - } - - // Step 3. Clear liveness data - // TODO: Merge it with step 0, but save live data in RegionData before. - for (size_t i = 0; i < heap->num_regions(); i++) { - ShenandoahHeapRegion* r = heap->get_region(i); - if (r->used() > 0) { - r->clear_live_data(); - } - } - - collection_set->update_region_status(); - - _last_cset_select = ShenandoahHeapRegion::seqnum_current_alloc(); -} - -bool ShenandoahTraversalHeuristics::should_start_gc() const { - ShenandoahHeap* heap = ShenandoahHeap::heap(); - assert(!heap->has_forwarded_objects(), "no forwarded objects here"); - - size_t capacity = heap->max_capacity(); - size_t available = heap->free_set()->available(); - - // Check if we are falling below the worst limit, time to trigger the GC, regardless of - // anything else. - size_t min_threshold = capacity / 100 * ShenandoahMinFreeThreshold; - if (available < min_threshold) { - log_info(gc)("Trigger: Free (" SIZE_FORMAT "%s) is below minimum threshold (" SIZE_FORMAT "%s)", - byte_size_in_proper_unit(available), proper_unit_for_byte_size(available), - byte_size_in_proper_unit(min_threshold), proper_unit_for_byte_size(min_threshold)); - return true; - } - - // Check if are need to learn a bit about the application - const size_t max_learn = ShenandoahLearningSteps; - if (_gc_times_learned < max_learn) { - size_t init_threshold = capacity / 100 * ShenandoahInitFreeThreshold; - if (available < init_threshold) { - log_info(gc)("Trigger: Learning " SIZE_FORMAT " of " SIZE_FORMAT ". Free (" SIZE_FORMAT "%s) is below initial threshold (" SIZE_FORMAT "%s)", - _gc_times_learned + 1, max_learn, - byte_size_in_proper_unit(available), proper_unit_for_byte_size(available), - byte_size_in_proper_unit(init_threshold), proper_unit_for_byte_size(init_threshold)); - return true; - } - } - - // Check if allocation headroom is still okay. This also factors in: - // 1. Some space to absorb allocation spikes - // 2. Accumulated penalties from Degenerated and Full GC - - size_t allocation_headroom = available; - - size_t spike_headroom = capacity / 100 * ShenandoahAllocSpikeFactor; - size_t penalties = capacity / 100 * _gc_time_penalties; - - allocation_headroom -= MIN2(allocation_headroom, spike_headroom); - allocation_headroom -= MIN2(allocation_headroom, penalties); - - double average_gc = _gc_time_history->avg(); - double time_since_last = time_since_last_gc(); - double allocation_rate = heap->bytes_allocated_since_gc_start() / time_since_last; - - if (average_gc > allocation_headroom / allocation_rate) { - log_info(gc)("Trigger: Average GC time (%.2f ms) is above the time for allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s)", - average_gc * 1000, - byte_size_in_proper_unit(allocation_rate), proper_unit_for_byte_size(allocation_rate), - byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom)); - log_info(gc, ergo)("Free headroom: " SIZE_FORMAT "%s (free) - " SIZE_FORMAT "%s (spike) - " SIZE_FORMAT "%s (penalties) = " SIZE_FORMAT "%s", - byte_size_in_proper_unit(available), proper_unit_for_byte_size(available), - byte_size_in_proper_unit(spike_headroom), proper_unit_for_byte_size(spike_headroom), - byte_size_in_proper_unit(penalties), proper_unit_for_byte_size(penalties), - byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom)); - return true; - } else if (ShenandoahHeuristics::should_start_gc()) { - return true; - } - - return false; -} - -void ShenandoahTraversalHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* set, - RegionData* data, size_t data_size, - size_t free) { - ShouldNotReachHere(); -} diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp deleted file mode 100644 index 3d902f4e52..0000000000 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALHEURISTICS_HPP -#define SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALHEURISTICS_HPP - -#include "gc/shenandoah/shenandoahHeuristics.hpp" - -class ShenandoahTraversalHeuristics : public ShenandoahHeuristics { -private: - uint64_t _last_cset_select; - -protected: - virtual void choose_collection_set_from_regiondata(ShenandoahCollectionSet* set, - RegionData* data, size_t data_size, - size_t free); - -public: - ShenandoahTraversalHeuristics(); - - virtual bool is_experimental(); - - virtual bool is_diagnostic(); - - virtual const char* name(); - - virtual void choose_collection_set(ShenandoahCollectionSet* collection_set); - - virtual bool should_start_gc() const; -}; - -#endif // SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALHEURISTICS_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp index dfd06c126b..a86320d1e1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp @@ -28,7 +28,6 @@ #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahHeapRegionSet.inline.hpp" #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" #include "gc/shenandoah/shenandoahUtils.hpp" #include "memory/resourceArea.hpp" @@ -69,9 +68,6 @@ void ShenandoahAsserts::print_obj(ShenandoahMessageBuffer& msg, oop obj) { msg.append(" %3s allocated after mark start\n", ctx->allocated_after_mark_start((HeapWord *) obj) ? "" : "not"); msg.append(" %3s marked \n", ctx->is_marked(obj) ? "" : "not"); msg.append(" %3s in collection set\n", heap->in_collection_set(obj) ? "" : "not"); - if (heap->traversal_gc() != NULL) { - msg.append(" %3s in traversal set\n", heap->traversal_gc()->traversal_set()->is_in(obj) ? "" : "not"); - } msg.append(" mark:%s\n", mw_ss.as_string()); msg.append(" region: %s", ss.as_string()); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp index 934503eca6..ade721d64f 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp @@ -31,7 +31,6 @@ #include "gc/shenandoah/shenandoahConcurrentRoots.hpp" #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahHeuristics.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" #include "memory/iterator.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #ifdef COMPILER1 @@ -105,9 +104,8 @@ bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators,Basic bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0; bool unknown = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode(); bool on_weak_ref = (decorators & (ON_WEAK_OOP_REF | ON_PHANTOM_OOP_REF)) != 0; - return (on_weak_ref || unknown) && (keep_alive || is_traversal_mode); + return (on_weak_ref || unknown) && keep_alive; } oop ShenandoahBarrierSet::load_reference_barrier_not_null(oop obj) { @@ -141,7 +139,7 @@ oop ShenandoahBarrierSet::load_reference_barrier_mutator_work(oop obj, T* load_a oop fwd = resolve_forwarded_not_null_mutator(obj); if (obj == fwd) { - assert(_heap->is_gc_in_progress_mask(ShenandoahHeap::EVACUATION | ShenandoahHeap::TRAVERSAL), + assert(_heap->is_evacuation_in_progress(), "evac should be in progress"); ShenandoahEvacOOMScope scope; @@ -159,7 +157,7 @@ oop ShenandoahBarrierSet::load_reference_barrier_mutator_work(oop obj, T* load_a oop ShenandoahBarrierSet::load_reference_barrier_impl(oop obj) { assert(ShenandoahLoadRefBarrier, "should be enabled"); if (!CompressedOops::is_null(obj)) { - bool evac_in_progress = _heap->is_gc_in_progress_mask(ShenandoahHeap::EVACUATION | ShenandoahHeap::TRAVERSAL); + bool evac_in_progress = _heap->is_evacuation_in_progress(); oop fwd = resolve_forwarded_not_null(obj); if (evac_in_progress && _heap->in_collection_set(obj) && diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp index 9a733b0f10..f17c721c9e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp @@ -53,7 +53,6 @@ inline oop ShenandoahBarrierSet::resolve_forwarded_not_null_mutator(oop p) { } inline void ShenandoahBarrierSet::enqueue(oop obj) { - shenandoah_assert_not_forwarded_if(NULL, obj, _heap->is_concurrent_traversal_in_progress()); assert(_satb_mark_queue_set.is_active(), "only get here when SATB active"); // Filter marked objects before hitting the SATB queues. The same predicate would @@ -86,7 +85,7 @@ inline void ShenandoahBarrierSet::satb_enqueue(oop value) { } inline void ShenandoahBarrierSet::storeval_barrier(oop obj) { - if (obj != NULL && ShenandoahStoreValEnqueueBarrier && _heap->is_concurrent_traversal_in_progress()) { + if (obj != NULL && ShenandoahStoreValEnqueueBarrier) { enqueue(obj); } } @@ -321,9 +320,6 @@ void ShenandoahBarrierSet::arraycopy_update_impl(T* src, size_t count) { if (_heap->is_evacuation_in_progress()) { ShenandoahEvacOOMScope oom_evac; arraycopy_work(src, count); - } else if (_heap->is_concurrent_traversal_in_progress()){ - ShenandoahEvacOOMScope oom_evac; - arraycopy_work(src, count); } else if (_heap->has_forwarded_objects()) { arraycopy_work(src, count); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp index c9ad6cabf7..e4290beda7 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp @@ -86,10 +86,6 @@ void ShenandoahBarrierSet::clone_barrier(oop obj) { ShenandoahEvacOOMScope evac_scope; ShenandoahUpdateRefsForOopClosure cl; obj->oop_iterate(&cl); - } else if (_heap->is_concurrent_traversal_in_progress()) { - ShenandoahEvacOOMScope evac_scope; - ShenandoahUpdateRefsForOopClosure cl; - obj->oop_iterate(&cl); } else { ShenandoahUpdateRefsForOopClosure cl; obj->oop_iterate(&cl); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahClosures.hpp b/src/hotspot/share/gc/shenandoah/shenandoahClosures.hpp index 7ba2afc0ed..38964f4b45 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahClosures.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahClosures.hpp @@ -66,20 +66,6 @@ private: inline void do_oop_work(T* p); }; -class ShenandoahTraversalUpdateRefsClosure: public OopClosure { -private: - ShenandoahHeap* const _heap; - ShenandoahHeapRegionSet* const _traversal_set; - -public: - inline ShenandoahTraversalUpdateRefsClosure(); - inline void do_oop(oop* p); - inline void do_oop(narrowOop* p); -private: - template - inline void do_oop_work(T* p); -}; - class ShenandoahEvacuateUpdateRootsClosure: public BasicOopIterateClosure { private: ShenandoahHeap* _heap; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahClosures.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahClosures.inline.hpp index 0373906515..7bb89d622a 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahClosures.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahClosures.inline.hpp @@ -28,7 +28,6 @@ #include "gc/shenandoah/shenandoahClosures.hpp" #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahNMethod.inline.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" #include "oops/compressedOops.inline.hpp" #include "runtime/atomic.hpp" #include "runtime/thread.hpp" @@ -42,9 +41,7 @@ bool ShenandoahForwardedIsAliveClosure::do_object_b(oop obj) { return false; } obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj); - shenandoah_assert_not_forwarded_if(NULL, obj, - (ShenandoahHeap::heap()->is_concurrent_mark_in_progress() || - ShenandoahHeap::heap()->is_concurrent_traversal_in_progress())); + shenandoah_assert_not_forwarded_if(NULL, obj, ShenandoahHeap::heap()->is_concurrent_mark_in_progress()); return _mark_context->is_marked(obj); } @@ -82,29 +79,6 @@ void ShenandoahUpdateRefsClosure::do_oop_work(T* p) { void ShenandoahUpdateRefsClosure::do_oop(oop* p) { do_oop_work(p); } void ShenandoahUpdateRefsClosure::do_oop(narrowOop* p) { do_oop_work(p); } -ShenandoahTraversalUpdateRefsClosure::ShenandoahTraversalUpdateRefsClosure() : - _heap(ShenandoahHeap::heap()), - _traversal_set(ShenandoahHeap::heap()->traversal_gc()->traversal_set()) { - assert(_heap->is_traversal_mode(), "Why we here?"); -} - -template -void ShenandoahTraversalUpdateRefsClosure::do_oop_work(T* p) { - T o = RawAccess<>::oop_load(p); - if (!CompressedOops::is_null(o)) { - oop obj = CompressedOops::decode_not_null(o); - if (_heap->in_collection_set(obj) || _traversal_set->is_in(obj)) { - obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj); - RawAccess::oop_store(p, obj); - } else { - shenandoah_assert_not_forwarded(p, obj); - } - } -} - -void ShenandoahTraversalUpdateRefsClosure::do_oop(oop* p) { do_oop_work(p); } -void ShenandoahTraversalUpdateRefsClosure::do_oop(narrowOop* p) { do_oop_work(p); } - ShenandoahEvacuateUpdateRootsClosure::ShenandoahEvacuateUpdateRootsClosure() : _heap(ShenandoahHeap::heap()), _thread(Thread::current()) { } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.hpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.hpp index 8a43766e73..296fdb5d38 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.hpp @@ -32,7 +32,6 @@ class ShenandoahStrDedupQueue; class ShenandoahConcurrentMark: public CHeapObj { - friend class ShenandoahTraversalGC; private: ShenandoahHeap* _heap; ShenandoahObjToScanQueueSet* _task_queues; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.inline.hpp index d93a8ec048..c8be353a72 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.inline.hpp @@ -39,7 +39,7 @@ template void ShenandoahConcurrentMark::do_task(ShenandoahObjToScanQueue* q, T* cl, jushort* live_data, ShenandoahMarkTask* task) { oop obj = task->obj(); - shenandoah_assert_not_forwarded_except(NULL, obj, _heap->is_concurrent_traversal_in_progress() && _heap->cancelled_gc()); + shenandoah_assert_not_forwarded(NULL, obj); shenandoah_assert_marked(NULL, obj); shenandoah_assert_not_in_cset_except(NULL, obj, _heap->cancelled_gc()); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentRoots.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentRoots.cpp index a04b7e1642..fd68787536 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentRoots.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentRoots.cpp @@ -27,8 +27,7 @@ #include "gc/shenandoah/shenandoahHeap.inline.hpp" bool ShenandoahConcurrentRoots::can_do_concurrent_roots() { - // Don't support traversal GC at this moment - return !ShenandoahHeap::heap()->is_traversal_mode(); + return true; } bool ShenandoahConcurrentRoots::should_do_concurrent_roots() { @@ -39,8 +38,7 @@ bool ShenandoahConcurrentRoots::should_do_concurrent_roots() { bool ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() { #if defined(X86) && !defined(SOLARIS) return ShenandoahCodeRootsStyle == 2 && - ClassUnloading && - strcmp(ShenandoahGCMode, "traversal") != 0; + ClassUnloading; #else return false; #endif diff --git a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp index ac713f9b0e..c20ab5cc85 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp @@ -31,7 +31,6 @@ #include "gc/shenandoah/shenandoahHeuristics.hpp" #include "gc/shenandoah/shenandoahMonitoringSupport.hpp" #include "gc/shenandoah/shenandoahControlThread.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" #include "gc/shenandoah/shenandoahUtils.hpp" #include "gc/shenandoah/shenandoahVMOperations.hpp" #include "gc/shenandoah/shenandoahWorkerPolicy.hpp" @@ -69,10 +68,8 @@ void ShenandoahPeriodicSATBFlushTask::task() { void ShenandoahControlThread::run_service() { ShenandoahHeap* heap = ShenandoahHeap::heap(); - GCMode default_mode = heap->is_traversal_mode() ? - concurrent_traversal : concurrent_normal; - GCCause::Cause default_cause = heap->is_traversal_mode() ? - GCCause::_shenandoah_traversal_gc : GCCause::_shenandoah_concurrent_gc; + GCMode default_mode = concurrent_normal; + GCCause::Cause default_cause = GCCause::_shenandoah_concurrent_gc; int sleep = ShenandoahControlIntervalMin; double last_shrink_time = os::elapsedTime(); @@ -191,9 +188,6 @@ void ShenandoahControlThread::run_service() { } switch (mode) { - case concurrent_traversal: - service_concurrent_traversal_cycle(cause); - break; case concurrent_normal: service_concurrent_normal_cycle(cause); break; @@ -286,31 +280,6 @@ void ShenandoahControlThread::run_service() { } } -void ShenandoahControlThread::service_concurrent_traversal_cycle(GCCause::Cause cause) { - GCIdMark gc_id_mark; - ShenandoahGCSession session(cause); - - ShenandoahHeap* heap = ShenandoahHeap::heap(); - TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters()); - - // Reset for upcoming cycle - heap->entry_reset(); - - heap->vmop_entry_init_traversal(); - - if (check_cancellation_or_degen(ShenandoahHeap::_degenerated_traversal)) return; - - heap->entry_traversal(); - if (check_cancellation_or_degen(ShenandoahHeap::_degenerated_traversal)) return; - - heap->vmop_entry_final_traversal(); - - heap->entry_cleanup(); - - heap->heuristics()->record_success_concurrent(); - heap->shenandoah_policy()->record_success_concurrent(); -} - void ShenandoahControlThread::service_concurrent_normal_cycle(GCCause::Cause cause) { // Normal cycle goes via all concurrent phases. If allocation failure (af) happens during // any of the concurrent phases, it first degrades to Degenerated GC and completes GC there. diff --git a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.hpp b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.hpp index 662d27adae..96cd5ad503 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.hpp @@ -57,7 +57,6 @@ class ShenandoahControlThread: public ConcurrentGCThread { private: typedef enum { none, - concurrent_traversal, concurrent_normal, stw_degenerated, stw_full @@ -93,7 +92,6 @@ private: void service_concurrent_normal_cycle(GCCause::Cause cause); void service_stw_full_cycle(GCCause::Cause cause); void service_stw_degenerated_cycle(GCCause::Cause cause, ShenandoahHeap::ShenandoahDegenPoint point); - void service_concurrent_traversal_cycle(GCCause::Cause cause); void service_uncommit(double shrink_before); bool try_set_alloc_failure_gc(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp index 73f84a4907..a55df57a74 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp @@ -27,7 +27,6 @@ #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahHeapRegionSet.hpp" #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" #include "logging/logStream.hpp" #include "runtime/orderAccess.hpp" @@ -178,9 +177,6 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah // Allocation successful, bump stats: if (req.is_mutator_alloc()) { increase_used(size * HeapWordSize); - if (_heap->is_traversal_mode()) { - r->update_seqnum_last_alloc_mutator(); - } } // Record actual allocation size @@ -188,14 +184,6 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah if (req.is_gc_alloc()) { r->set_update_watermark(r->top()); - if (_heap->is_concurrent_traversal_in_progress()) { - // Traversal needs to traverse through GC allocs. Adjust TAMS to the new top - // so that these allocations appear below TAMS, and thus get traversed. - // See top of shenandoahTraversal.cpp for an explanation. - _heap->marking_context()->capture_top_at_mark_start(r); - _heap->traversal_gc()->traversal_set()->add_region_check_for_duplicates(r); - OrderAccess::fence(); - } } } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index a76f41ba1b..9a38fb271f 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -58,7 +58,6 @@ #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp" #include "gc/shenandoah/shenandoahStringDedup.hpp" #include "gc/shenandoah/shenandoahTaskqueue.hpp" -#include "gc/shenandoah/shenandoahTraversalMode.hpp" #include "gc/shenandoah/shenandoahUtils.hpp" #include "gc/shenandoah/shenandoahVerifier.hpp" #include "gc/shenandoah/shenandoahCodeRoots.hpp" @@ -379,10 +378,6 @@ jint ShenandoahHeap::initialize() { _pacer = NULL; } - _traversal_gc = strcmp(ShenandoahGCMode, "traversal") == 0 ? - new ShenandoahTraversalGC(this, _num_regions) : - NULL; - _control_thread = new ShenandoahControlThread(); log_info(gc, init)("Initialize Shenandoah heap: " SIZE_FORMAT "%s initial, " SIZE_FORMAT "%s min, " SIZE_FORMAT "%s max", @@ -400,9 +395,7 @@ jint ShenandoahHeap::initialize() { void ShenandoahHeap::initialize_heuristics() { if (ShenandoahGCMode != NULL) { - if (strcmp(ShenandoahGCMode, "traversal") == 0) { - _gc_mode = new ShenandoahTraversalMode(); - } else if (strcmp(ShenandoahGCMode, "normal") == 0) { + if (strcmp(ShenandoahGCMode, "normal") == 0) { _gc_mode = new ShenandoahNormalMode(); } else if (strcmp(ShenandoahGCMode, "passive") == 0) { _gc_mode = new ShenandoahPassiveMode(); @@ -452,7 +445,6 @@ ShenandoahHeap::ShenandoahHeap(ShenandoahCollectorPolicy* policy) : _heuristics(NULL), _free_set(NULL), _scm(new ShenandoahConcurrentMark()), - _traversal_gc(NULL), _full_gc(new ShenandoahMarkCompact()), _pacer(NULL), _verifier(NULL), @@ -549,7 +541,6 @@ void ShenandoahHeap::print_on(outputStream* st) const { if (is_concurrent_mark_in_progress()) st->print("marking, "); if (is_evacuation_in_progress()) st->print("evacuating, "); if (is_update_refs_in_progress()) st->print("updating refs, "); - if (is_concurrent_traversal_in_progress()) st->print("traversal, "); if (is_degenerated_gc_in_progress()) st->print("degenerated gc, "); if (is_full_gc_in_progress()) st->print("full gc, "); if (is_full_gc_move_in_progress()) st->print("full gc move, "); @@ -1664,18 +1655,6 @@ void ShenandoahHeap::op_preclean() { concurrent_mark()->preclean_weak_refs(); } -void ShenandoahHeap::op_init_traversal() { - traversal_gc()->init_traversal_collection(); -} - -void ShenandoahHeap::op_traversal() { - traversal_gc()->concurrent_traversal_collection(); -} - -void ShenandoahHeap::op_final_traversal() { - traversal_gc()->final_traversal_collection(); -} - void ShenandoahHeap::op_full(GCCause::Cause cause) { ShenandoahMetricsSnapshot metrics; metrics.snap_before(); @@ -1708,24 +1687,6 @@ void ShenandoahHeap::op_degenerated(ShenandoahDegenPoint point) { metrics.snap_before(); switch (point) { - case _degenerated_traversal: - { - // Drop the collection set. Note: this leaves some already forwarded objects - // behind, which may be problematic, see comments for ShenandoahEvacAssist - // workarounds in ShenandoahTraversalHeuristics. - - ShenandoahHeapLocker locker(lock()); - collection_set()->clear_current_index(); - for (size_t i = 0; i < collection_set()->count(); i++) { - ShenandoahHeapRegion* r = collection_set()->next(); - r->make_regular_bypass(); - } - collection_set()->clear(); - } - op_final_traversal(); - op_cleanup(); - return; - // The cases below form the Duff's-like device: it describes the actual GC cycle, // but enters it at different points, depending on which concurrent phase had // degenerated. @@ -1742,13 +1703,6 @@ void ShenandoahHeap::op_degenerated(ShenandoahDegenPoint point) { set_process_references(heuristics()->can_process_references()); set_unload_classes(heuristics()->can_unload_classes()); - if (is_traversal_mode()) { - // Not possible to degenerate from here, upgrade to Full GC right away. - cancel_gc(GCCause::_shenandoah_upgrade_to_full_gc); - op_degenerated_fail(); - return; - } - op_reset(); op_init_mark(); @@ -1874,7 +1828,7 @@ void ShenandoahHeap::op_degenerated_futile() { } void ShenandoahHeap::force_satb_flush_all_threads() { - if (!is_concurrent_mark_in_progress() && !is_concurrent_traversal_in_progress()) { + if (!is_concurrent_mark_in_progress()) { // No need to flush SATBs return; } @@ -1908,11 +1862,6 @@ void ShenandoahHeap::set_concurrent_mark_in_progress(bool in_progress) { ShenandoahBarrierSet::satb_mark_queue_set().set_active_all_threads(in_progress, !in_progress); } -void ShenandoahHeap::set_concurrent_traversal_in_progress(bool in_progress) { - set_gc_state_mask(TRAVERSAL, in_progress); - ShenandoahBarrierSet::satb_mark_queue_set().set_active_all_threads(in_progress, !in_progress); -} - void ShenandoahHeap::set_evacuation_in_progress(bool in_progress) { assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Only call this at safepoint"); set_gc_state_mask(EVACUATION, in_progress); @@ -2051,19 +2000,11 @@ void ShenandoahHeap::stw_process_weak_roots(bool full_gc) { // Cleanup weak roots if (has_forwarded_objects()) { - if (is_traversal_mode()) { - ShenandoahForwardedIsAliveClosure is_alive; - ShenandoahTraversalUpdateRefsClosure keep_alive; - ShenandoahParallelWeakRootsCleaningTask - cleaning_task(&is_alive, &keep_alive, num_workers); - _workers->run_task(&cleaning_task); - } else { - ShenandoahForwardedIsAliveClosure is_alive; - ShenandoahUpdateRefsClosure keep_alive; - ShenandoahParallelWeakRootsCleaningTask - cleaning_task(&is_alive, &keep_alive, num_workers); - _workers->run_task(&cleaning_task); - } + ShenandoahForwardedIsAliveClosure is_alive; + ShenandoahUpdateRefsClosure keep_alive; + ShenandoahParallelWeakRootsCleaningTask + cleaning_task(&is_alive, &keep_alive, num_workers); + _workers->run_task(&cleaning_task); } else { ShenandoahIsAliveClosure is_alive; #ifdef ASSERT @@ -2087,12 +2028,7 @@ void ShenandoahHeap::parallel_cleaning(bool full_gc) { } void ShenandoahHeap::set_has_forwarded_objects(bool cond) { - if (is_traversal_mode()) { - set_gc_state_mask(HAS_FORWARDED | UPDATEREFS, cond); - } else { - set_gc_state_mask(HAS_FORWARDED, cond); - } - + set_gc_state_mask(HAS_FORWARDED, cond); } void ShenandoahHeap::set_process_references(bool pr) { @@ -2529,26 +2465,6 @@ void ShenandoahHeap::vmop_entry_final_updaterefs() { VMThread::execute(&op); } -void ShenandoahHeap::vmop_entry_init_traversal() { - TraceCollectorStats tcs(monitoring_support()->stw_collection_counters()); - ShenandoahGCPhase total(ShenandoahPhaseTimings::total_pause_gross); - ShenandoahGCPhase phase(ShenandoahPhaseTimings::init_traversal_gc_gross); - - try_inject_alloc_failure(); - VM_ShenandoahInitTraversalGC op; - VMThread::execute(&op); -} - -void ShenandoahHeap::vmop_entry_final_traversal() { - TraceCollectorStats tcs(monitoring_support()->stw_collection_counters()); - ShenandoahGCPhase total(ShenandoahPhaseTimings::total_pause_gross); - ShenandoahGCPhase phase(ShenandoahPhaseTimings::final_traversal_gc_gross); - - try_inject_alloc_failure(); - VM_ShenandoahFinalTraversalGC op; - VMThread::execute(&op); -} - void ShenandoahHeap::vmop_entry_full(GCCause::Cause cause) { TraceCollectorStats tcs(monitoring_support()->full_stw_collection_counters()); ShenandoahGCPhase total(ShenandoahPhaseTimings::total_pause_gross); @@ -2624,36 +2540,6 @@ void ShenandoahHeap::entry_final_updaterefs() { op_final_updaterefs(); } -void ShenandoahHeap::entry_init_traversal() { - ShenandoahGCPhase total_phase(ShenandoahPhaseTimings::total_pause); - ShenandoahGCPhase phase(ShenandoahPhaseTimings::init_traversal_gc); - - static const char* msg = init_traversal_event_message(); - GCTraceTime(Info, gc) time(msg, gc_timer()); - EventMark em("%s", msg); - - ShenandoahWorkerScope scope(workers(), - ShenandoahWorkerPolicy::calc_workers_for_stw_traversal(), - "init traversal"); - - op_init_traversal(); -} - -void ShenandoahHeap::entry_final_traversal() { - ShenandoahGCPhase total_phase(ShenandoahPhaseTimings::total_pause); - ShenandoahGCPhase phase(ShenandoahPhaseTimings::final_traversal_gc); - - static const char* msg = final_traversal_event_message(); - GCTraceTime(Info, gc) time(msg, gc_timer()); - EventMark em("%s", msg); - - ShenandoahWorkerScope scope(workers(), - ShenandoahWorkerPolicy::calc_workers_for_stw_traversal(), - "final traversal"); - - op_final_traversal(); -} - void ShenandoahHeap::entry_full(GCCause::Cause cause) { ShenandoahGCPhase total_phase(ShenandoahPhaseTimings::total_pause); ShenandoahGCPhase phase(ShenandoahPhaseTimings::full_gc); @@ -2794,21 +2680,6 @@ void ShenandoahHeap::entry_preclean() { } } -void ShenandoahHeap::entry_traversal() { - static const char* msg = conc_traversal_event_message(); - GCTraceTime(Info, gc) time(msg); - EventMark em("%s", msg); - - TraceCollectorStats tcs(monitoring_support()->concurrent_collection_counters()); - - ShenandoahWorkerScope scope(workers(), - ShenandoahWorkerPolicy::calc_workers_for_conc_traversal(), - "concurrent traversal"); - - try_inject_alloc_failure(); - op_traversal(); -} - void ShenandoahHeap::entry_uncommit(double shrink_before) { static const char *msg = "Concurrent uncommit"; GCTraceTime(Info, gc) time(msg, NULL, GCCause::_no_gc, true); @@ -2943,57 +2814,10 @@ const char* ShenandoahHeap::conc_mark_event_message() const { } } -const char* ShenandoahHeap::init_traversal_event_message() const { - bool proc_refs = process_references(); - bool unload_cls = unload_classes(); - - if (proc_refs && unload_cls) { - return "Pause Init Traversal (process weakrefs) (unload classes)"; - } else if (proc_refs) { - return "Pause Init Traversal (process weakrefs)"; - } else if (unload_cls) { - return "Pause Init Traversal (unload classes)"; - } else { - return "Pause Init Traversal"; - } -} - -const char* ShenandoahHeap::final_traversal_event_message() const { - bool proc_refs = process_references(); - bool unload_cls = unload_classes(); - - if (proc_refs && unload_cls) { - return "Pause Final Traversal (process weakrefs) (unload classes)"; - } else if (proc_refs) { - return "Pause Final Traversal (process weakrefs)"; - } else if (unload_cls) { - return "Pause Final Traversal (unload classes)"; - } else { - return "Pause Final Traversal"; - } -} - -const char* ShenandoahHeap::conc_traversal_event_message() const { - bool proc_refs = process_references(); - bool unload_cls = unload_classes(); - - if (proc_refs && unload_cls) { - return "Concurrent Traversal (process weakrefs) (unload classes)"; - } else if (proc_refs) { - return "Concurrent Traversal (process weakrefs)"; - } else if (unload_cls) { - return "Concurrent Traversal (unload classes)"; - } else { - return "Concurrent Traversal"; - } -} - const char* ShenandoahHeap::degen_event_message(ShenandoahDegenPoint point) const { switch (point) { case _degenerated_unset: return "Pause Degenerated GC ()"; - case _degenerated_traversal: - return "Pause Degenerated GC (Traversal)"; case _degenerated_outside_cycle: return "Pause Degenerated GC (Outside of Cycle)"; case _degenerated_mark: diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp index 6690399fe6..fa01c91072 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp @@ -57,7 +57,6 @@ class ShenandoahConcurrentMark; class ShenandoahMarkCompact; class ShenandoahMonitoringSupport; class ShenandoahPacer; -class ShenandoahTraversalGC; class ShenandoahVerifier; class ShenandoahWorkGang; class VMStructs; @@ -250,9 +249,6 @@ public: // Heap is under updating: needs no additional barriers. UPDATEREFS_BITPOS = 3, - - // Heap is under traversal collection - TRAVERSAL_BITPOS = 4 }; enum GCState { @@ -261,7 +257,6 @@ public: MARKING = 1 << MARKING_BITPOS, EVACUATION = 1 << EVACUATION_BITPOS, UPDATEREFS = 1 << UPDATEREFS_BITPOS, - TRAVERSAL = 1 << TRAVERSAL_BITPOS }; private: @@ -285,7 +280,6 @@ public: void set_degenerated_gc_in_progress(bool in_progress); void set_full_gc_in_progress(bool in_progress); void set_full_gc_move_in_progress(bool in_progress); - void set_concurrent_traversal_in_progress(bool in_progress); void set_has_forwarded_objects(bool cond); void set_concurrent_root_in_progress(bool cond); @@ -297,7 +291,6 @@ public: inline bool is_degenerated_gc_in_progress() const; inline bool is_full_gc_in_progress() const; inline bool is_full_gc_move_in_progress() const; - inline bool is_concurrent_traversal_in_progress() const; inline bool has_forwarded_objects() const; inline bool is_gc_in_progress_mask(uint mask) const; inline bool is_stw_gc_in_progress() const; @@ -310,7 +303,6 @@ public: public: enum ShenandoahDegenPoint { _degenerated_unset, - _degenerated_traversal, _degenerated_outside_cycle, _degenerated_mark, _degenerated_evac, @@ -322,8 +314,6 @@ public: switch (point) { case _degenerated_unset: return ""; - case _degenerated_traversal: - return "Traversal"; case _degenerated_outside_cycle: return "Outside of Cycle"; case _degenerated_mark: @@ -376,8 +366,6 @@ public: void vmop_entry_final_mark(); void vmop_entry_init_updaterefs(); void vmop_entry_final_updaterefs(); - void vmop_entry_init_traversal(); - void vmop_entry_final_traversal(); void vmop_entry_full(GCCause::Cause cause); void vmop_degenerated(ShenandoahDegenPoint point); @@ -387,8 +375,6 @@ public: void entry_final_mark(); void entry_init_updaterefs(); void entry_final_updaterefs(); - void entry_init_traversal(); - void entry_final_traversal(); void entry_full(GCCause::Cause cause); void entry_degenerated(int point); @@ -401,7 +387,6 @@ public: void entry_cleanup(); void entry_evac(); void entry_updaterefs(); - void entry_traversal(); void entry_uncommit(double shrink_before); private: @@ -410,8 +395,6 @@ private: void op_final_mark(); void op_init_updaterefs(); void op_final_updaterefs(); - void op_init_traversal(); - void op_final_traversal(); void op_full(GCCause::Cause cause); void op_degenerated(ShenandoahDegenPoint point); void op_degenerated_fail(); @@ -425,7 +408,6 @@ private: void op_conc_evac(); void op_stw_evac(); void op_updaterefs(); - void op_traversal(); void op_uncommit(double shrink_before); // Messages for GC trace events, they have to be immortal for @@ -433,9 +415,6 @@ private: const char* init_mark_event_message() const; const char* final_mark_event_message() const; const char* conc_mark_event_message() const; - const char* init_traversal_event_message() const; - const char* final_traversal_event_message() const; - const char* conc_traversal_event_message() const; const char* degen_event_message(ShenandoahDegenPoint point) const; // ---------- GC subsystems @@ -447,7 +426,6 @@ private: ShenandoahHeuristics* _heuristics; ShenandoahFreeSet* _free_set; ShenandoahConcurrentMark* _scm; - ShenandoahTraversalGC* _traversal_gc; ShenandoahMarkCompact* _full_gc; ShenandoahPacer* _pacer; ShenandoahVerifier* _verifier; @@ -462,8 +440,6 @@ public: ShenandoahHeuristics* heuristics() const { return _heuristics; } ShenandoahFreeSet* free_set() const { return _free_set; } ShenandoahConcurrentMark* concurrent_mark() { return _scm; } - ShenandoahTraversalGC* traversal_gc() const { return _traversal_gc; } - bool is_traversal_mode() const { return _traversal_gc != NULL; } ShenandoahPacer* pacer() const { return _pacer; } ShenandoahPhaseTimings* phase_timings() const { return _phase_timings; } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp index d12368d30a..d5d9d8cf28 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp @@ -251,7 +251,6 @@ inline oop ShenandoahHeap::evacuate_object(oop p, Thread* thread) { } assert(ShenandoahThreadLocalData::is_evac_allowed(thread), "must be enclosed in oom-evac scope"); - assert(is_concurrent_traversal_in_progress() || !is_traversal_mode(), "Should not evacuate objects"); size_t size = p->size(); @@ -343,17 +342,13 @@ inline bool ShenandoahHeap::is_stable() const { } inline bool ShenandoahHeap::is_idle() const { - return _gc_state.is_unset(MARKING | EVACUATION | UPDATEREFS | TRAVERSAL); + return _gc_state.is_unset(MARKING | EVACUATION | UPDATEREFS); } inline bool ShenandoahHeap::is_concurrent_mark_in_progress() const { return _gc_state.is_set(MARKING); } -inline bool ShenandoahHeap::is_concurrent_traversal_in_progress() const { - return _gc_state.is_set(TRAVERSAL); -} - inline bool ShenandoahHeap::is_evacuation_in_progress() const { return _gc_state.is_set(EVACUATION); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp index 30db6051ce..e4519ed557 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp @@ -27,7 +27,6 @@ #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahHeapRegion.hpp" #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" #include "gc/shared/space.inline.hpp" #include "jfr/jfrEvents.hpp" #include "memory/iterator.inline.hpp" @@ -52,8 +51,6 @@ size_t ShenandoahHeapRegion::HumongousThresholdWords = 0; size_t ShenandoahHeapRegion::MaxTLABSizeBytes = 0; size_t ShenandoahHeapRegion::MaxTLABSizeWords = 0; -ShenandoahHeapRegion::PaddedAllocSeqNum ShenandoahHeapRegion::_alloc_seq_num; - ShenandoahHeapRegion::ShenandoahHeapRegion(HeapWord* start, size_t index, bool committed) : _index(index), _bottom(start), @@ -64,7 +61,6 @@ ShenandoahHeapRegion::ShenandoahHeapRegion(HeapWord* start, size_t index, bool c _top(start), _tlab_allocs(0), _gclab_allocs(0), - _seqnum_last_alloc_mutator(0), _live_data(0), _critical_pins(0), _update_watermark(start) { @@ -309,27 +305,17 @@ void ShenandoahHeapRegion::clear_live_data() { void ShenandoahHeapRegion::reset_alloc_metadata() { _tlab_allocs = 0; _gclab_allocs = 0; - _seqnum_last_alloc_mutator = 0; } void ShenandoahHeapRegion::reset_alloc_metadata_to_shared() { if (used() > 0) { _tlab_allocs = 0; _gclab_allocs = 0; - if (ShenandoahHeap::heap()->is_traversal_mode()) { - update_seqnum_last_alloc_mutator(); - } } else { reset_alloc_metadata(); } } -void ShenandoahHeapRegion::update_seqnum_last_alloc_mutator() { - assert(ShenandoahHeap::heap()->is_traversal_mode(), "Sanity"); - shenandoah_assert_heaplocked_or_safepoint(); - _seqnum_last_alloc_mutator = _alloc_seq_num.value++; -} - size_t ShenandoahHeapRegion::get_shared_allocs() const { return used() - (_tlab_allocs + _gclab_allocs) * HeapWordSize; } @@ -417,7 +403,6 @@ void ShenandoahHeapRegion::print_on(outputStream* st) const { st->print("|S " SIZE_FORMAT_W(5) "%1s", byte_size_in_proper_unit(get_shared_allocs()), proper_unit_for_byte_size(get_shared_allocs())); st->print("|L " SIZE_FORMAT_W(5) "%1s", byte_size_in_proper_unit(get_live_data_bytes()), proper_unit_for_byte_size(get_live_data_bytes())); st->print("|CP " SIZE_FORMAT_W(3), pin_count()); - st->print("|SN " UINT64_FORMAT_X_W(12), _seqnum_last_alloc_mutator); st->cr(); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp index 5819b71970..a0c084198c 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp @@ -221,21 +221,6 @@ private: static size_t MaxTLABSizeBytes; static size_t MaxTLABSizeWords; - // Global allocation counter, increased for each allocation under Shenandoah heap lock. - // Padded to avoid false sharing with the read-only fields above. - struct PaddedAllocSeqNum { - shenandoah_padding(0); - uint64_t value; - shenandoah_padding(1); - - PaddedAllocSeqNum() { - // start with 1, reserve 0 for uninitialized value - value = 1; - } - }; - - static PaddedAllocSeqNum _alloc_seq_num; - // Never updated fields size_t const _index; HeapWord* const _bottom; @@ -254,8 +239,6 @@ private: size_t _tlab_allocs; size_t _gclab_allocs; - uint64_t _seqnum_last_alloc_mutator; - volatile size_t _live_data; volatile size_t _critical_pins; @@ -344,11 +327,6 @@ public: return ShenandoahHeapRegion::MaxTLABSizeWords; } - static uint64_t seqnum_current_alloc() { - // Last used seq number - return _alloc_seq_num.value - 1; - } - inline size_t index() const { return _index; } @@ -404,9 +382,6 @@ public: size_t get_tlab_allocs() const; size_t get_gclab_allocs() const; - inline uint64_t seqnum_last_alloc_mutator() const; - void update_seqnum_last_alloc_mutator(); - HeapWord* get_update_watermark() const { // Updates to the update-watermark only happen at safepoints or, when pushing // back the watermark for evacuation regions, under the Shenandoah heap-lock. diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp index 017e75816e..bd0ea5c7d2 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp @@ -88,9 +88,4 @@ inline void ShenandoahHeapRegion::internal_increase_live_data(size_t s) { #endif } -inline uint64_t ShenandoahHeapRegion::seqnum_last_alloc_mutator() const { - assert(ShenandoahHeap::heap()->is_traversal_mode(), "Sanity"); - return _seqnum_last_alloc_mutator; -} - #endif // SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGION_INLINE_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.cpp index 7820489bf7..19524caa8b 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.cpp @@ -84,7 +84,6 @@ void ShenandoahHeapRegionCounters::update() { if (heap->is_concurrent_mark_in_progress()) status |= 1 << 0; if (heap->is_evacuation_in_progress()) status |= 1 << 1; if (heap->is_update_refs_in_progress()) status |= 1 << 2; - if (heap->is_concurrent_traversal_in_progress()) status |= 1 << 3; _status->set_value(status); _timestamp->set_value(os::elapsed_counter()); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.hpp index 9db1f70d6e..68c81f3f68 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.hpp @@ -39,7 +39,6 @@ * - bit 0 set when marking in progress * - bit 1 set when evacuation in progress * - bit 2 set when update refs in progress - * - bit 3 set when traversal in progress * * two variable counters per region, with $max_regions (see above) counters: * - sun.gc.shenandoah.regions.region.$i.data diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp index 0069e9e3eb..dc152dda25 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp @@ -37,7 +37,6 @@ #include "gc/shenandoah/shenandoahHeuristics.hpp" #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp" #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" #include "gc/shenandoah/shenandoahTaskqueue.inline.hpp" #include "gc/shenandoah/shenandoahUtils.hpp" #include "gc/shenandoah/shenandoahVerifier.hpp" @@ -102,12 +101,6 @@ void ShenandoahMarkCompact::do_it(GCCause::Cause gc_cause) { } assert(!heap->is_update_refs_in_progress(), "sanity"); - // a3. Cancel concurrent traversal GC, if in progress - if (heap->is_concurrent_traversal_in_progress()) { - heap->traversal_gc()->reset(); - heap->set_concurrent_traversal_in_progress(false); - } - // b. Cancel concurrent mark, if in progress if (heap->is_concurrent_mark_in_progress()) { heap->concurrent_mark()->cancel(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp index 57f67cc458..1fd752a9a4 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp @@ -28,7 +28,6 @@ #include "gc/shenandoah/shenandoahHeap.hpp" #include "gc/shenandoah/shenandoahStrDedupQueue.hpp" #include "gc/shenandoah/shenandoahTaskqueue.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" #include "memory/iterator.hpp" #include "runtime/thread.hpp" @@ -199,159 +198,4 @@ public: virtual void do_oop(oop* p) { do_oop_work(p); } }; -class ShenandoahTraversalSuperClosure : public MetadataVisitingOopIterateClosure { -private: - ShenandoahTraversalGC* const _traversal_gc; - Thread* const _thread; - ShenandoahObjToScanQueue* const _queue; - ShenandoahMarkingContext* const _mark_context; -protected: - ShenandoahTraversalSuperClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : - MetadataVisitingOopIterateClosure(rp), - _traversal_gc(ShenandoahHeap::heap()->traversal_gc()), - _thread(Thread::current()), - _queue(q), - _mark_context(ShenandoahHeap::heap()->marking_context()) { - } - - template - void work(T* p); - -}; - -class ShenandoahTraversalRootsClosure : public ShenandoahTraversalSuperClosure { -private: - template - inline void do_oop_work(T* p) { work(p); } - -public: - ShenandoahTraversalRootsClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : - ShenandoahTraversalSuperClosure(q, rp) {} - - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } - - virtual bool do_metadata() { return false; } -}; - -class ShenandoahTraversalClosure : public ShenandoahTraversalSuperClosure { -private: - template - inline void do_oop_work(T* p) { work(p); } - -public: - ShenandoahTraversalClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : - ShenandoahTraversalSuperClosure(q, rp) {} - - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } - - virtual bool do_metadata() { return false; } -}; - -class ShenandoahTraversalMetadataClosure : public ShenandoahTraversalSuperClosure { -private: - template - inline void do_oop_work(T* p) { work(p); } - -public: - ShenandoahTraversalMetadataClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : - ShenandoahTraversalSuperClosure(q, rp) {} - - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } - - virtual bool do_metadata() { return true; } -}; - -class ShenandoahTraversalDedupClosure : public ShenandoahTraversalSuperClosure { -private: - template - inline void do_oop_work(T* p) { work(p); } - -public: - ShenandoahTraversalDedupClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : - ShenandoahTraversalSuperClosure(q, rp) {} - - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } - - virtual bool do_metadata() { return false; } -}; - -class ShenandoahTraversalMetadataDedupClosure : public ShenandoahTraversalSuperClosure { -private: - template - inline void do_oop_work(T* p) { work(p); } - -public: - ShenandoahTraversalMetadataDedupClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : - ShenandoahTraversalSuperClosure(q, rp) {} - - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } - - virtual bool do_metadata() { return true; } -}; - -class ShenandoahTraversalDegenClosure : public ShenandoahTraversalSuperClosure { -private: - template - inline void do_oop_work(T* p) { work(p); } - -public: - ShenandoahTraversalDegenClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : - ShenandoahTraversalSuperClosure(q, rp) {} - - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } - - virtual bool do_metadata() { return false; } -}; - -class ShenandoahTraversalMetadataDegenClosure : public ShenandoahTraversalSuperClosure { -private: - template - inline void do_oop_work(T* p) { work(p); } - -public: - ShenandoahTraversalMetadataDegenClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : - ShenandoahTraversalSuperClosure(q, rp) {} - - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } - - virtual bool do_metadata() { return true; } -}; - -class ShenandoahTraversalDedupDegenClosure : public ShenandoahTraversalSuperClosure { -private: - template - inline void do_oop_work(T* p) { work(p); } - -public: - ShenandoahTraversalDedupDegenClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : - ShenandoahTraversalSuperClosure(q, rp) {} - - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } - - virtual bool do_metadata() { return false; } -}; - -class ShenandoahTraversalMetadataDedupDegenClosure : public ShenandoahTraversalSuperClosure { -private: - template - inline void do_oop_work(T* p) { work(p); } - -public: - ShenandoahTraversalMetadataDedupDegenClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : - ShenandoahTraversalSuperClosure(q, rp) {} - - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } - - virtual bool do_metadata() { return true; } -}; - #endif // SHARE_GC_SHENANDOAH_SHENANDOAHOOPCLOSURES_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp index cf3720721f..10e22952e3 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp @@ -26,7 +26,6 @@ #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.inline.hpp" template inline void ShenandoahMarkRefsSuperClosure::work(T *p) { @@ -38,9 +37,4 @@ inline void ShenandoahUpdateHeapRefsClosure::do_oop_work(T* p) { _heap->maybe_update_with_forwarded(p); } -template -inline void ShenandoahTraversalSuperClosure::work(T* p) { - _traversal_gc->process_oop(p, _thread, _queue, _mark_context); -} - #endif // SHARE_GC_SHENANDOAH_SHENANDOAHOOPCLOSURES_INLINE_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp b/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp index 542321c5f7..86d52e1978 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp @@ -127,33 +127,6 @@ void ShenandoahPacer::setup_for_updaterefs() { tax); } -/* - * Traversal walks the entire heap once, and therefore we have to make assumptions about its - * liveness, like concurrent mark does. - */ - -void ShenandoahPacer::setup_for_traversal() { - assert(ShenandoahPacing, "Only be here when pacing is enabled"); - - size_t live = update_and_get_progress_history(); - size_t free = _heap->free_set()->available(); - - size_t non_taxable = free * ShenandoahPacingCycleSlack / 100; - size_t taxable = free - non_taxable; - - double tax = 1.0 * live / taxable; // base tax for available free space - tax *= ShenandoahPacingSurcharge; // additional surcharge to help unclutter heap - - restart_with(non_taxable, tax); - - log_info(gc, ergo)("Pacer for Traversal. Expected Live: " SIZE_FORMAT "%s, Free: " SIZE_FORMAT "%s, " - "Non-Taxable: " SIZE_FORMAT "%s, Alloc Tax Rate: %.1fx", - byte_size_in_proper_unit(live), proper_unit_for_byte_size(live), - byte_size_in_proper_unit(free), proper_unit_for_byte_size(free), - byte_size_in_proper_unit(non_taxable), proper_unit_for_byte_size(non_taxable), - tax); -} - /* * In idle phase, we have to pace the application to let control thread react with GC start. * diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp b/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp index ba8092dd70..fbee2e0c12 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp @@ -72,7 +72,6 @@ public: void setup_for_mark(); void setup_for_evac(); void setup_for_updaterefs(); - void setup_for_traversal(); void setup_for_reset(); void setup_for_preclean(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp index b162a43f4b..43f5993b96 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp @@ -75,9 +75,6 @@ void ShenandoahPhaseTimings::record_workers_end(Phase phase) { guarantee(phase == init_evac || phase == scan_roots || phase == update_roots || - phase == init_traversal_gc_work || - phase == final_traversal_gc_work || - phase == final_traversal_update_roots || phase == final_update_refs_roots || phase == full_gc_roots || phase == degen_gc_update_roots || diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp index fdae05acce..92a82d8b7c 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp @@ -105,24 +105,6 @@ class outputStream; f(degen_gc_update_roots, " Degen Update Roots") \ SHENANDOAH_GC_PAR_PHASE_DO(degen_gc_update_, " DU: ", f) \ \ - f(init_traversal_gc_gross, "Pause Init Traversal (G)") \ - f(init_traversal_gc, "Pause Init Traversal (N)") \ - f(traversal_gc_prepare, " Prepare") \ - f(traversal_gc_make_parsable, " Make Parsable") \ - f(traversal_gc_resize_tlabs, " Resize TLABs") \ - f(traversal_gc_prepare_sync_pinned, " Sync Pinned") \ - f(init_traversal_gc_work, " Work") \ - SHENANDOAH_GC_PAR_PHASE_DO(init_traversal_, " TI: ", f) \ - \ - f(final_traversal_gc_gross, "Pause Final Traversal (G)") \ - f(final_traversal_gc, "Pause Final Traversal (N)") \ - f(final_traversal_gc_work, " Work") \ - SHENANDOAH_GC_PAR_PHASE_DO(final_trav_gc_, " TF: ", f) \ - f(final_traversal_update_roots, " Update Roots") \ - SHENANDOAH_GC_PAR_PHASE_DO(final_trav_update_, " TU: ", f) \ - f(traversal_gc_sync_pinned, " Sync Pinned") \ - f(traversal_gc_cleanup, " Cleanup") \ - \ f(full_gc_gross, "Pause Full GC (G)") \ f(full_gc, "Pause Full GC (N)") \ f(full_gc_heapdumps, " Heap Dumps") \ @@ -156,7 +138,6 @@ class outputStream; f(conc_evac, "Concurrent Evacuation") \ f(conc_update_refs, "Concurrent Update Refs") \ f(conc_cleanup, "Concurrent Cleanup") \ - f(conc_traversal, "Concurrent Traversal") \ \ f(conc_uncommit, "Concurrent Uncommit") \ \ diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp index 31b1bc1a49..42b56dd66b 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp @@ -222,19 +222,15 @@ void ShenandoahRootScanner::strong_roots_do(uint worker_id, OopClosure* oop template void ShenandoahRootScanner::roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure *tc) { assert(!ShenandoahSafepoint::is_at_shenandoah_safepoint() || - !ShenandoahHeap::heap()->unload_classes() || - ShenandoahHeap::heap()->is_traversal_mode(), - "Expect class unloading or traversal when Shenandoah cycle is running"); + !ShenandoahHeap::heap()->unload_classes(), + "Expect class unloading when Shenandoah cycle is running"); ResourceMark rm; _serial_roots.oops_do(oops, worker_id); _vm_roots.oops_do(oops, worker_id); - if (clds != NULL) { - _cld_roots.cld_do(clds, worker_id); - } else { - assert(ShenandoahHeap::heap()->is_concurrent_traversal_in_progress(), "Only possible with traversal GC"); - } + assert(clds != NULL, "Only possible with CLD closure"); + _cld_roots.cld_do(clds, worker_id); // With ShenandoahConcurrentScanCodeRoots, we avoid scanning the entire code cache here, // and instead do that in concurrent phase under the relevant lock. This saves init mark diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp deleted file mode 100644 index 8f87597c11..0000000000 --- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp +++ /dev/null @@ -1,1113 +0,0 @@ -/* - * Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" - -#include "classfile/classLoaderData.hpp" -#include "classfile/classLoaderDataGraph.hpp" -#include "gc/shared/referenceProcessor.hpp" -#include "gc/shared/referenceProcessorPhaseTimes.hpp" -#include "gc/shared/workgroup.hpp" -#include "gc/shenandoah/shenandoahBarrierSet.hpp" -#include "gc/shenandoah/shenandoahClosures.inline.hpp" -#include "gc/shenandoah/shenandoahCodeRoots.hpp" -#include "gc/shenandoah/shenandoahCollectionSet.hpp" -#include "gc/shenandoah/shenandoahCollectorPolicy.hpp" -#include "gc/shenandoah/shenandoahFreeSet.hpp" -#include "gc/shenandoah/shenandoahPhaseTimings.hpp" -#include "gc/shenandoah/shenandoahHeap.inline.hpp" -#include "gc/shenandoah/shenandoahHeapRegionSet.inline.hpp" -#include "gc/shenandoah/shenandoahHeuristics.hpp" -#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp" -#include "gc/shenandoah/shenandoahOopClosures.inline.hpp" -#include "gc/shenandoah/shenandoahPhaseTimings.hpp" -#include "gc/shenandoah/shenandoahRootProcessor.inline.hpp" -#include "gc/shenandoah/shenandoahStringDedup.hpp" -#include "gc/shenandoah/shenandoahTaskqueue.inline.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" -#include "gc/shenandoah/shenandoahUtils.hpp" -#include "gc/shenandoah/shenandoahVerifier.hpp" - -#include "memory/iterator.hpp" -#include "memory/metaspace.hpp" -#include "memory/resourceArea.hpp" -#include "memory/universe.hpp" - -/** - * NOTE: We are using the SATB buffer in thread.hpp and satbMarkQueue.hpp, however, it is not an SATB algorithm. - * We're using the buffer as generic oop buffer to enqueue new values in concurrent oop stores, IOW, the algorithm - * is incremental-update-based. - * - * NOTE on interaction with TAMS: we want to avoid traversing new objects for - * several reasons: - * - We will not reclaim them in this cycle anyway, because they are not in the - * cset - * - It makes up for the bulk of work during final-pause - * - It also shortens the concurrent cycle because we don't need to - * pointlessly traverse through newly allocated objects. - * - As a nice side-effect, it solves the I-U termination problem (mutators - * cannot outrun the GC by allocating like crazy) - * - It is an easy way to achieve MWF. What MWF does is to also enqueue the - * target object of stores if it's new. Treating new objects live implicitely - * achieves the same, but without extra barriers. I think the effect of - * shortened final-pause (mentioned above) is the main advantage of MWF. In - * particular, we will not see the head of a completely new long linked list - * in final-pause and end up traversing huge chunks of the heap there. - * - We don't need to see/update the fields of new objects either, because they - * are either still null, or anything that's been stored into them has been - * evacuated+enqueued before (and will thus be treated later). - * - * We achieve this by setting TAMS for each region, and everything allocated - * beyond TAMS will be 'implicitely marked'. - * - * Gotchas: - * - While we want new objects to be implicitely marked, we don't want to count - * them alive. Otherwise the next cycle wouldn't pick them up and consider - * them for cset. This means that we need to protect such regions from - * getting accidentally thrashed at the end of traversal cycle. This is why I - * keep track of alloc-regions and check is_alloc_region() in the trashing - * code. - * - We *need* to traverse through evacuated objects. Those objects are - * pre-existing, and any references in them point to interesting objects that - * we need to see. We also want to count them as live, because we just - * determined that they are alive :-) I achieve this by upping TAMS - * concurrently for every gclab/gc-shared alloc before publishing the - * evacuated object. This way, the GC threads will not consider such objects - * implictely marked, and traverse through them as normal. - */ -class ShenandoahTraversalSATBBufferClosure : public SATBBufferClosure { -private: - ShenandoahObjToScanQueue* _queue; - ShenandoahTraversalGC* _traversal_gc; - ShenandoahHeap* const _heap; - -public: - ShenandoahTraversalSATBBufferClosure(ShenandoahObjToScanQueue* q) : - _queue(q), - _heap(ShenandoahHeap::heap()) - { } - - void do_buffer(void** buffer, size_t size) { - for (size_t i = 0; i < size; ++i) { - oop* p = (oop*) &buffer[i]; - oop obj = RawAccess<>::oop_load(p); - shenandoah_assert_not_forwarded(p, obj); - if (_heap->marking_context()->mark(obj)) { - _queue->push(ShenandoahMarkTask(obj)); - } - } - } -}; - -class ShenandoahTraversalSATBThreadsClosure : public ThreadClosure { -private: - ShenandoahTraversalSATBBufferClosure* _satb_cl; - -public: - ShenandoahTraversalSATBThreadsClosure(ShenandoahTraversalSATBBufferClosure* satb_cl) : - _satb_cl(satb_cl) {} - - void do_thread(Thread* thread) { - ShenandoahThreadLocalData::satb_mark_queue(thread).apply_closure_and_empty(_satb_cl); - } -}; - -// Like CLDToOopClosure, but clears has_modified_oops, so that we can record modified CLDs during traversal -// and remark them later during final-traversal. -class ShenandoahMarkCLDClosure : public CLDClosure { -private: - OopClosure* _cl; -public: - ShenandoahMarkCLDClosure(OopClosure* cl) : _cl(cl) {} - void do_cld(ClassLoaderData* cld) { - cld->oops_do(_cl, ClassLoaderData::_claim_strong, true); - } -}; - -// Like CLDToOopClosure, but only process modified CLDs -class ShenandoahRemarkCLDClosure : public CLDClosure { -private: - OopClosure* _cl; -public: - ShenandoahRemarkCLDClosure(OopClosure* cl) : _cl(cl) {} - void do_cld(ClassLoaderData* cld) { - if (cld->has_modified_oops()) { - cld->oops_do(_cl, ClassLoaderData::_claim_strong, true); - } - } -}; - -class ShenandoahInitTraversalCollectionTask : public AbstractGangTask { -private: - ShenandoahCSetRootScanner* _rp; - ShenandoahHeap* _heap; - -public: - ShenandoahInitTraversalCollectionTask(ShenandoahCSetRootScanner* rp) : - AbstractGangTask("Shenandoah Init Traversal Collection"), - _rp(rp), - _heap(ShenandoahHeap::heap()) {} - - void work(uint worker_id) { - ShenandoahParallelWorkerSession worker_session(worker_id); - - ShenandoahObjToScanQueueSet* queues = _heap->traversal_gc()->task_queues(); - ShenandoahObjToScanQueue* q = queues->queue(worker_id); - - bool process_refs = _heap->process_references(); - bool unload_classes = _heap->unload_classes(); - ReferenceProcessor* rp = NULL; - if (process_refs) { - rp = _heap->ref_processor(); - } - - // Step 1: Process ordinary GC roots. - { - ShenandoahTraversalRootsClosure roots_cl(q, rp); - ShenandoahMarkCLDClosure cld_cl(&roots_cl); - MarkingCodeBlobClosure code_cl(&roots_cl, CodeBlobToOopClosure::FixRelocations); - if (unload_classes) { - _rp->roots_do(worker_id, &roots_cl, NULL, &code_cl); - } else { - _rp->roots_do(worker_id, &roots_cl, &cld_cl, &code_cl); - } - } - } -}; - -class ShenandoahConcurrentTraversalCollectionTask : public AbstractGangTask { -private: - ShenandoahTaskTerminator* _terminator; - ShenandoahHeap* _heap; -public: - ShenandoahConcurrentTraversalCollectionTask(ShenandoahTaskTerminator* terminator) : - AbstractGangTask("Shenandoah Concurrent Traversal Collection"), - _terminator(terminator), - _heap(ShenandoahHeap::heap()) {} - - void work(uint worker_id) { - ShenandoahConcurrentWorkerSession worker_session(worker_id); - ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers); - ShenandoahTraversalGC* traversal_gc = _heap->traversal_gc(); - - // Drain all outstanding work in queues. - traversal_gc->main_loop(worker_id, _terminator, true); - } -}; - -class ShenandoahFinalTraversalCollectionTask : public AbstractGangTask { -private: - ShenandoahAllRootScanner* _rp; - ShenandoahTaskTerminator* _terminator; - ShenandoahHeap* _heap; -public: - ShenandoahFinalTraversalCollectionTask(ShenandoahAllRootScanner* rp, ShenandoahTaskTerminator* terminator) : - AbstractGangTask("Shenandoah Final Traversal Collection"), - _rp(rp), - _terminator(terminator), - _heap(ShenandoahHeap::heap()) {} - - void work(uint worker_id) { - ShenandoahParallelWorkerSession worker_session(worker_id); - - ShenandoahTraversalGC* traversal_gc = _heap->traversal_gc(); - - ShenandoahObjToScanQueueSet* queues = traversal_gc->task_queues(); - ShenandoahObjToScanQueue* q = queues->queue(worker_id); - - bool process_refs = _heap->process_references(); - bool unload_classes = _heap->unload_classes(); - ReferenceProcessor* rp = NULL; - if (process_refs) { - rp = _heap->ref_processor(); - } - - // Step 0: Drain outstanding SATB queues. - // NOTE: we piggy-back draining of remaining thread SATB buffers on the final root scan below. - ShenandoahTraversalSATBBufferClosure satb_cl(q); - { - // Process remaining finished SATB buffers. - SATBMarkQueueSet& satb_mq_set = ShenandoahBarrierSet::satb_mark_queue_set(); - while (satb_mq_set.apply_closure_to_completed_buffer(&satb_cl)); - // Process remaining threads SATB buffers below. - } - - // Step 1: Process GC roots. - // For oops in code roots, they are marked, evacuated, enqueued for further traversal, - // and the references to the oops are updated during init pause. We only need to rescan - // on stack code roots, in case of class unloading is enabled. Otherwise, code roots are - // scanned during init traversal or degenerated GC will update them at the end. - if (!_heap->is_degenerated_gc_in_progress()) { - ShenandoahTraversalRootsClosure roots_cl(q, rp); - ShenandoahTraversalSATBThreadsClosure tc(&satb_cl); - if (unload_classes) { - ShenandoahRemarkCLDClosure remark_cld_cl(&roots_cl); - MarkingCodeBlobClosure code_cl(&roots_cl, CodeBlobToOopClosure::FixRelocations); - _rp->strong_roots_do(worker_id, &roots_cl, &remark_cld_cl, &code_cl, &tc); - } else { - CLDToOopClosure cld_cl(&roots_cl, ClassLoaderData::_claim_strong); - _rp->roots_do(worker_id, &roots_cl, &cld_cl, NULL, &tc); - } - } else { - ShenandoahTraversalDegenClosure roots_cl(q, rp); - ShenandoahTraversalSATBThreadsClosure tc(&satb_cl); - if (unload_classes) { - ShenandoahRemarkCLDClosure remark_cld_cl(&roots_cl); - _rp->strong_roots_do(worker_id, &roots_cl, &remark_cld_cl, NULL, &tc); - } else { - CLDToOopClosure cld_cl(&roots_cl, ClassLoaderData::_claim_strong); - _rp->roots_do(worker_id, &roots_cl, &cld_cl, NULL, &tc); - } - } - - { - ShenandoahWorkerTimingsTracker timer(ShenandoahPhaseTimings::FinishQueues, worker_id); - - // Step 3: Finally drain all outstanding work in queues. - traversal_gc->main_loop(worker_id, _terminator, false); - } - - } -}; - -ShenandoahTraversalGC::ShenandoahTraversalGC(ShenandoahHeap* heap, size_t num_regions) : - _heap(heap), - _task_queues(new ShenandoahObjToScanQueueSet(heap->max_workers())), - _traversal_set(ShenandoahHeapRegionSet()) { - - // Traversal does not support concurrent code root scanning - FLAG_SET_DEFAULT(ShenandoahConcurrentScanCodeRoots, false); - - uint num_queues = heap->max_workers(); - for (uint i = 0; i < num_queues; ++i) { - ShenandoahObjToScanQueue* task_queue = new ShenandoahObjToScanQueue(); - task_queue->initialize(); - _task_queues->register_queue(i, task_queue); - } -} - -ShenandoahTraversalGC::~ShenandoahTraversalGC() { -} - -void ShenandoahTraversalGC::prepare_regions() { - size_t num_regions = _heap->num_regions(); - ShenandoahMarkingContext* const ctx = _heap->marking_context(); - for (size_t i = 0; i < num_regions; i++) { - ShenandoahHeapRegion* region = _heap->get_region(i); - region->set_update_watermark(region->top()); - if (_heap->is_bitmap_slice_committed(region)) { - if (_traversal_set.is_in(i)) { - ctx->capture_top_at_mark_start(region); - region->clear_live_data(); - assert(ctx->is_bitmap_clear_range(region->bottom(), region->end()), "bitmap for traversal regions must be cleared"); - } else { - // Everything outside the traversal set is always considered live. - ctx->reset_top_at_mark_start(region); - } - } else { - // FreeSet may contain uncommitted empty regions, once they are recommitted, - // their TAMS may have old values, so reset them here. - ctx->reset_top_at_mark_start(region); - } - } -} - -void ShenandoahTraversalGC::prepare() { - { - ShenandoahGCPhase phase(ShenandoahPhaseTimings::traversal_gc_make_parsable); - _heap->make_parsable(true); - } - - if (UseTLAB) { - ShenandoahGCPhase phase(ShenandoahPhaseTimings::traversal_gc_resize_tlabs); - _heap->resize_tlabs(); - } - - assert(_heap->marking_context()->is_bitmap_clear(), "need clean mark bitmap"); - assert(!_heap->marking_context()->is_complete(), "should not be complete"); - - // About to choose the collection set, make sure we know which regions are pinned. - { - ShenandoahGCPhase phase_cleanup(ShenandoahPhaseTimings::traversal_gc_prepare_sync_pinned); - _heap->sync_pinned_region_status(); - } - - ShenandoahCollectionSet* collection_set = _heap->collection_set(); - { - ShenandoahHeapLocker lock(_heap->lock()); - - collection_set->clear(); - assert(collection_set->count() == 0, "collection set not clear"); - - // Find collection set - _heap->heuristics()->choose_collection_set(collection_set); - prepare_regions(); - - // Rebuild free set - _heap->free_set()->rebuild(); - } - - log_info(gc, ergo)("Collectable Garbage: " SIZE_FORMAT "%s, " SIZE_FORMAT "%s CSet, " SIZE_FORMAT " CSet regions", - byte_size_in_proper_unit(collection_set->garbage()), proper_unit_for_byte_size(collection_set->garbage()), - byte_size_in_proper_unit(collection_set->live_data()), proper_unit_for_byte_size(collection_set->live_data()), - collection_set->count()); -} - -void ShenandoahTraversalGC::init_traversal_collection() { - assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "STW traversal GC"); - - if (ShenandoahVerify) { - _heap->verifier()->verify_before_traversal(); - } - - if (VerifyBeforeGC) { - Universe::verify(); - } - - { - ShenandoahGCPhase phase_prepare(ShenandoahPhaseTimings::traversal_gc_prepare); - prepare(); - } - - _heap->set_concurrent_traversal_in_progress(true); - _heap->set_has_forwarded_objects(true); - - bool process_refs = _heap->process_references(); - if (process_refs) { - ReferenceProcessor* rp = _heap->ref_processor(); - rp->enable_discovery(true /*verify_no_refs*/); - rp->setup_policy(_heap->soft_ref_policy()->should_clear_all_soft_refs()); - } - - { - ShenandoahGCPhase phase_work(ShenandoahPhaseTimings::init_traversal_gc_work); - assert(_task_queues->is_empty(), "queues must be empty before traversal GC"); - TASKQUEUE_STATS_ONLY(_task_queues->reset_taskqueue_stats()); - -#if COMPILER2_OR_JVMCI - DerivedPointerTable::clear(); -#endif - - { - uint nworkers = _heap->workers()->active_workers(); - task_queues()->reserve(nworkers); - ShenandoahCSetRootScanner rp(nworkers, ShenandoahPhaseTimings::init_traversal_gc_work); - ShenandoahInitTraversalCollectionTask traversal_task(&rp); - _heap->workers()->run_task(&traversal_task); - } - -#if COMPILER2_OR_JVMCI - DerivedPointerTable::update_pointers(); -#endif - } - - if (ShenandoahPacing) { - _heap->pacer()->setup_for_traversal(); - } -} - -void ShenandoahTraversalGC::main_loop(uint w, ShenandoahTaskTerminator* t, bool sts_yield) { - ShenandoahObjToScanQueue* q = task_queues()->queue(w); - - // Initialize live data. - jushort* ld = _heap->get_liveness_cache(w); - - ReferenceProcessor* rp = NULL; - if (_heap->process_references()) { - rp = _heap->ref_processor(); - } - { - if (!_heap->is_degenerated_gc_in_progress()) { - if (_heap->unload_classes()) { - if (ShenandoahStringDedup::is_enabled()) { - ShenandoahTraversalMetadataDedupClosure cl(q, rp); - main_loop_work(&cl, ld, w, t, sts_yield); - } else { - ShenandoahTraversalMetadataClosure cl(q, rp); - main_loop_work(&cl, ld, w, t, sts_yield); - } - } else { - if (ShenandoahStringDedup::is_enabled()) { - ShenandoahTraversalDedupClosure cl(q, rp); - main_loop_work(&cl, ld, w, t, sts_yield); - } else { - ShenandoahTraversalClosure cl(q, rp); - main_loop_work(&cl, ld, w, t, sts_yield); - } - } - } else { - if (_heap->unload_classes()) { - if (ShenandoahStringDedup::is_enabled()) { - ShenandoahTraversalMetadataDedupDegenClosure cl(q, rp); - main_loop_work(&cl, ld, w, t, sts_yield); - } else { - ShenandoahTraversalMetadataDegenClosure cl(q, rp); - main_loop_work(&cl, ld, w, t, sts_yield); - } - } else { - if (ShenandoahStringDedup::is_enabled()) { - ShenandoahTraversalDedupDegenClosure cl(q, rp); - main_loop_work(&cl, ld, w, t, sts_yield); - } else { - ShenandoahTraversalDegenClosure cl(q, rp); - main_loop_work(&cl, ld, w, t, sts_yield); - } - } - } - } - - _heap->flush_liveness_cache(w); -} - -template -void ShenandoahTraversalGC::main_loop_work(T* cl, jushort* live_data, uint worker_id, ShenandoahTaskTerminator* terminator, bool sts_yield) { - ShenandoahObjToScanQueueSet* queues = task_queues(); - ShenandoahObjToScanQueue* q = queues->queue(worker_id); - ShenandoahConcurrentMark* conc_mark = _heap->concurrent_mark(); - - uintx stride = ShenandoahMarkLoopStride; - - ShenandoahMarkTask task; - - // Process outstanding queues, if any. - q = queues->claim_next(); - while (q != NULL) { - if (_heap->check_cancelled_gc_and_yield(sts_yield)) { - return; - } - - for (uint i = 0; i < stride; i++) { - if (q->pop(task)) { - conc_mark->do_task(q, cl, live_data, &task); - } else { - assert(q->is_empty(), "Must be empty"); - q = queues->claim_next(); - break; - } - } - } - - if (check_and_handle_cancelled_gc(terminator, sts_yield)) return; - - // Normal loop. - q = queues->queue(worker_id); - - ShenandoahTraversalSATBBufferClosure drain_satb(q); - SATBMarkQueueSet& satb_mq_set = ShenandoahBarrierSet::satb_mark_queue_set(); - - while (true) { - if (check_and_handle_cancelled_gc(terminator, sts_yield)) return; - - while (satb_mq_set.completed_buffers_num() > 0) { - satb_mq_set.apply_closure_to_completed_buffer(&drain_satb); - } - - uint work = 0; - for (uint i = 0; i < stride; i++) { - if (q->pop(task) || - queues->steal(worker_id, task)) { - conc_mark->do_task(q, cl, live_data, &task); - work++; - } else { - break; - } - } - - if (work == 0) { - // No more work, try to terminate - ShenandoahSuspendibleThreadSetLeaver stsl(sts_yield && ShenandoahSuspendibleWorkers); - ShenandoahTerminatorTerminator tt(_heap); - - if (terminator->offer_termination(&tt)) return; - } - } -} - -bool ShenandoahTraversalGC::check_and_handle_cancelled_gc(ShenandoahTaskTerminator* terminator, bool sts_yield) { - if (_heap->cancelled_gc()) { - return true; - } - return false; -} - -void ShenandoahTraversalGC::concurrent_traversal_collection() { - ShenandoahGCPhase phase_work(ShenandoahPhaseTimings::conc_traversal); - if (!_heap->cancelled_gc()) { - uint nworkers = _heap->workers()->active_workers(); - task_queues()->reserve(nworkers); - - ShenandoahTaskTerminator terminator(nworkers, task_queues()); - ShenandoahConcurrentTraversalCollectionTask task(&terminator); - _heap->workers()->run_task(&task); - } - - if (!_heap->cancelled_gc() && ShenandoahPreclean && _heap->process_references()) { - preclean_weak_refs(); - } -} - -void ShenandoahTraversalGC::final_traversal_collection() { - if (!_heap->cancelled_gc()) { -#if COMPILER2_OR_JVMCI - DerivedPointerTable::clear(); -#endif - ShenandoahGCPhase phase_work(ShenandoahPhaseTimings::final_traversal_gc_work); - uint nworkers = _heap->workers()->active_workers(); - task_queues()->reserve(nworkers); - - // Finish traversal - ShenandoahAllRootScanner rp(nworkers, ShenandoahPhaseTimings::final_traversal_gc_work); - ShenandoahTaskTerminator terminator(nworkers, task_queues()); - ShenandoahFinalTraversalCollectionTask task(&rp, &terminator); - _heap->workers()->run_task(&task); -#if COMPILER2_OR_JVMCI - DerivedPointerTable::update_pointers(); -#endif - } - - if (!_heap->cancelled_gc() && _heap->process_references()) { - weak_refs_work(); - } - - if (!_heap->cancelled_gc()) { - assert(_task_queues->is_empty(), "queues must be empty after traversal GC"); - TASKQUEUE_STATS_ONLY(_task_queues->print_taskqueue_stats()); - TASKQUEUE_STATS_ONLY(_task_queues->reset_taskqueue_stats()); - - // No more marking expected - _heap->set_concurrent_traversal_in_progress(false); - _heap->mark_complete_marking_context(); - - // A rare case, TLAB/GCLAB is initialized from an empty region without - // any live data, the region can be trashed and may be uncommitted in later code, - // that results the TLAB/GCLAB not usable. Retire them here. - _heap->make_parsable(true); - - _heap->parallel_cleaning(false); - fixup_roots(); - - _heap->set_has_forwarded_objects(false); - - // Resize metaspace - MetaspaceGC::compute_new_size(); - - // Need to see that pinned region status is updated: newly pinned regions must not - // be trashed. New unpinned regions should be trashed. - { - ShenandoahGCPhase phase_cleanup(ShenandoahPhaseTimings::traversal_gc_sync_pinned); - _heap->sync_pinned_region_status(); - } - - // Still good? We can now trash the cset, and make final verification - { - ShenandoahGCPhase phase_cleanup(ShenandoahPhaseTimings::traversal_gc_cleanup); - ShenandoahHeapLocker lock(_heap->lock()); - - // Trash everything - // Clear immediate garbage regions. - size_t num_regions = _heap->num_regions(); - - ShenandoahHeapRegionSet* traversal_regions = traversal_set(); - ShenandoahFreeSet* free_regions = _heap->free_set(); - ShenandoahMarkingContext* const ctx = _heap->marking_context(); - free_regions->clear(); - for (size_t i = 0; i < num_regions; i++) { - ShenandoahHeapRegion* r = _heap->get_region(i); - bool not_allocated = ctx->top_at_mark_start(r) == r->top(); - - bool candidate = traversal_regions->is_in(r) && !r->has_live() && not_allocated; - if (r->is_humongous_start() && candidate) { - // Trash humongous. - HeapWord* humongous_obj = r->bottom(); - assert(!ctx->is_marked(oop(humongous_obj)), "must not be marked"); - r->make_trash_immediate(); - while (i + 1 < num_regions && _heap->get_region(i + 1)->is_humongous_continuation()) { - i++; - r = _heap->get_region(i); - assert(r->is_humongous_continuation(), "must be humongous continuation"); - r->make_trash_immediate(); - } - } else if (!r->is_empty() && candidate) { - // Trash regular. - assert(!r->is_humongous(), "handled above"); - assert(!r->is_trash(), "must not already be trashed"); - r->make_trash_immediate(); - } - } - _heap->collection_set()->clear(); - _heap->free_set()->rebuild(); - reset(); - } - - assert(_task_queues->is_empty(), "queues must be empty after traversal GC"); - assert(!_heap->cancelled_gc(), "must not be cancelled when getting out here"); - - if (ShenandoahVerify) { - _heap->verifier()->verify_after_traversal(); - } -#ifdef ASSERT - else { - verify_roots_after_gc(); - } -#endif - - if (VerifyAfterGC) { - Universe::verify(); - } - } -} - -class ShenandoahVerifyAfterGC : public OopClosure { -private: - template - void do_oop_work(T* p) { - T o = RawAccess<>::oop_load(p); - if (!CompressedOops::is_null(o)) { - oop obj = CompressedOops::decode_not_null(o); - shenandoah_assert_correct(p, obj); - shenandoah_assert_not_in_cset_except(p, obj, ShenandoahHeap::heap()->cancelled_gc()); - shenandoah_assert_not_forwarded(p, obj); - } - } - -public: - void do_oop(narrowOop* p) { do_oop_work(p); } - void do_oop(oop* p) { do_oop_work(p); } -}; - -void ShenandoahTraversalGC::verify_roots_after_gc() { - ShenandoahRootVerifier verifier; - ShenandoahVerifyAfterGC cl; - verifier.oops_do(&cl); -} - -class ShenandoahTraversalFixRootsClosure : public OopClosure { -private: - template - inline void do_oop_work(T* p) { - T o = RawAccess<>::oop_load(p); - if (!CompressedOops::is_null(o)) { - oop obj = CompressedOops::decode_not_null(o); - oop forw = ShenandoahBarrierSet::resolve_forwarded_not_null(obj); - if (obj != forw) { - RawAccess::oop_store(p, forw); - } - } - } - -public: - inline void do_oop(oop* p) { do_oop_work(p); } - inline void do_oop(narrowOop* p) { do_oop_work(p); } -}; - -class ShenandoahTraversalFixRootsTask : public AbstractGangTask { -private: - ShenandoahRootUpdater* _rp; - -public: - ShenandoahTraversalFixRootsTask(ShenandoahRootUpdater* rp) : - AbstractGangTask("Shenandoah traversal fix roots"), - _rp(rp) { - assert(ShenandoahHeap::heap()->has_forwarded_objects(), "Must be"); - } - - void work(uint worker_id) { - ShenandoahParallelWorkerSession worker_session(worker_id); - ShenandoahTraversalFixRootsClosure cl; - ShenandoahForwardedIsAliveClosure is_alive; - _rp->roots_do(worker_id, &is_alive, &cl); - } -}; - -void ShenandoahTraversalGC::fixup_roots() { -#if COMPILER2_OR_JVMCI - DerivedPointerTable::clear(); -#endif - ShenandoahRootUpdater rp(_heap->workers()->active_workers(), ShenandoahPhaseTimings::final_traversal_update_roots); - ShenandoahTraversalFixRootsTask update_roots_task(&rp); - _heap->workers()->run_task(&update_roots_task); -#if COMPILER2_OR_JVMCI - DerivedPointerTable::update_pointers(); -#endif -} - -void ShenandoahTraversalGC::reset() { - _task_queues->clear(); -} - -ShenandoahObjToScanQueueSet* ShenandoahTraversalGC::task_queues() { - return _task_queues; -} - -class ShenandoahTraversalCancelledGCYieldClosure : public YieldClosure { -private: - ShenandoahHeap* const _heap; -public: - ShenandoahTraversalCancelledGCYieldClosure() : _heap(ShenandoahHeap::heap()) {}; - virtual bool should_return() { return _heap->cancelled_gc(); } -}; - -class ShenandoahTraversalPrecleanCompleteGCClosure : public VoidClosure { -public: - void do_void() { - ShenandoahHeap* sh = ShenandoahHeap::heap(); - ShenandoahTraversalGC* traversal_gc = sh->traversal_gc(); - assert(sh->process_references(), "why else would we be here?"); - ShenandoahTaskTerminator terminator(1, traversal_gc->task_queues()); - shenandoah_assert_rp_isalive_installed(); - traversal_gc->main_loop((uint) 0, &terminator, true); - } -}; - -class ShenandoahTraversalKeepAliveUpdateClosure : public OopClosure { -private: - ShenandoahObjToScanQueue* _queue; - Thread* _thread; - ShenandoahTraversalGC* _traversal_gc; - ShenandoahMarkingContext* const _mark_context; - - template - inline void do_oop_work(T* p) { - _traversal_gc->process_oop(p, _thread, _queue, _mark_context); - } - -public: - ShenandoahTraversalKeepAliveUpdateClosure(ShenandoahObjToScanQueue* q) : - _queue(q), _thread(Thread::current()), - _traversal_gc(ShenandoahHeap::heap()->traversal_gc()), - _mark_context(ShenandoahHeap::heap()->marking_context()) {} - - void do_oop(narrowOop* p) { do_oop_work(p); } - void do_oop(oop* p) { do_oop_work(p); } -}; - -class ShenandoahTraversalKeepAliveUpdateDegenClosure : public OopClosure { -private: - ShenandoahObjToScanQueue* _queue; - Thread* _thread; - ShenandoahTraversalGC* _traversal_gc; - ShenandoahMarkingContext* const _mark_context; - - template - inline void do_oop_work(T* p) { - _traversal_gc->process_oop(p, _thread, _queue, _mark_context); - } - -public: - ShenandoahTraversalKeepAliveUpdateDegenClosure(ShenandoahObjToScanQueue* q) : - _queue(q), _thread(Thread::current()), - _traversal_gc(ShenandoahHeap::heap()->traversal_gc()), - _mark_context(ShenandoahHeap::heap()->marking_context()) {} - - void do_oop(narrowOop* p) { do_oop_work(p); } - void do_oop(oop* p) { do_oop_work(p); } -}; - -class ShenandoahTraversalSingleThreadKeepAliveUpdateClosure : public OopClosure { -private: - ShenandoahObjToScanQueue* _queue; - Thread* _thread; - ShenandoahTraversalGC* _traversal_gc; - ShenandoahMarkingContext* const _mark_context; - - template - inline void do_oop_work(T* p) { - _traversal_gc->process_oop(p, _thread, _queue, _mark_context); - } - -public: - ShenandoahTraversalSingleThreadKeepAliveUpdateClosure(ShenandoahObjToScanQueue* q) : - _queue(q), _thread(Thread::current()), - _traversal_gc(ShenandoahHeap::heap()->traversal_gc()), - _mark_context(ShenandoahHeap::heap()->marking_context()) {} - - void do_oop(narrowOop* p) { do_oop_work(p); } - void do_oop(oop* p) { do_oop_work(p); } -}; - -class ShenandoahTraversalSingleThreadKeepAliveUpdateDegenClosure : public OopClosure { -private: - ShenandoahObjToScanQueue* _queue; - Thread* _thread; - ShenandoahTraversalGC* _traversal_gc; - ShenandoahMarkingContext* const _mark_context; - - template - inline void do_oop_work(T* p) { - _traversal_gc->process_oop(p, _thread, _queue, _mark_context); - } - -public: - ShenandoahTraversalSingleThreadKeepAliveUpdateDegenClosure(ShenandoahObjToScanQueue* q) : - _queue(q), _thread(Thread::current()), - _traversal_gc(ShenandoahHeap::heap()->traversal_gc()), - _mark_context(ShenandoahHeap::heap()->marking_context()) {} - - void do_oop(narrowOop* p) { do_oop_work(p); } - void do_oop(oop* p) { do_oop_work(p); } -}; - -class ShenandoahTraversalPrecleanTask : public AbstractGangTask { -private: - ReferenceProcessor* _rp; - -public: - ShenandoahTraversalPrecleanTask(ReferenceProcessor* rp) : - AbstractGangTask("Precleaning task"), - _rp(rp) {} - - void work(uint worker_id) { - assert(worker_id == 0, "The code below is single-threaded, only one worker is expected"); - ShenandoahParallelWorkerSession worker_session(worker_id); - ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers); - - ShenandoahHeap* sh = ShenandoahHeap::heap(); - - ShenandoahObjToScanQueue* q = sh->traversal_gc()->task_queues()->queue(worker_id); - - ShenandoahForwardedIsAliveClosure is_alive; - ShenandoahTraversalCancelledGCYieldClosure yield; - ShenandoahTraversalPrecleanCompleteGCClosure complete_gc; - ShenandoahTraversalKeepAliveUpdateClosure keep_alive(q); - ResourceMark rm; - _rp->preclean_discovered_references(&is_alive, &keep_alive, - &complete_gc, &yield, - NULL); - } -}; - -void ShenandoahTraversalGC::preclean_weak_refs() { - // Pre-cleaning weak references before diving into STW makes sense at the - // end of concurrent mark. This will filter out the references which referents - // are alive. Note that ReferenceProcessor already filters out these on reference - // discovery, and the bulk of work is done here. This phase processes leftovers - // that missed the initial filtering, i.e. when referent was marked alive after - // reference was discovered by RP. - - assert(_heap->process_references(), "sanity"); - assert(!_heap->is_degenerated_gc_in_progress(), "must be in concurrent non-degenerated phase"); - - // Shortcut if no references were discovered to avoid winding up threads. - ReferenceProcessor* rp = _heap->ref_processor(); - if (!rp->has_discovered_references()) { - return; - } - - ReferenceProcessorMTDiscoveryMutator fix_mt_discovery(rp, false); - - shenandoah_assert_rp_isalive_not_installed(); - ShenandoahForwardedIsAliveClosure is_alive; - ReferenceProcessorIsAliveMutator fix_isalive(rp, &is_alive); - - assert(task_queues()->is_empty(), "Should be empty"); - - // Execute precleaning in the worker thread: it will give us GCLABs, String dedup - // queues and other goodies. When upstream ReferenceProcessor starts supporting - // parallel precleans, we can extend this to more threads. - ShenandoahPushWorkerScope scope(_heap->workers(), 1, /* check_workers = */ false); - - WorkGang* workers = _heap->workers(); - uint nworkers = workers->active_workers(); - assert(nworkers == 1, "This code uses only a single worker"); - task_queues()->reserve(nworkers); - - ShenandoahTraversalPrecleanTask task(rp); - workers->run_task(&task); - - assert(_heap->cancelled_gc() || task_queues()->is_empty(), "Should be empty"); -} - -// Weak Reference Closures -class ShenandoahTraversalDrainMarkingStackClosure: public VoidClosure { - uint _worker_id; - ShenandoahTaskTerminator* _terminator; - bool _reset_terminator; - -public: - ShenandoahTraversalDrainMarkingStackClosure(uint worker_id, ShenandoahTaskTerminator* t, bool reset_terminator = false): - _worker_id(worker_id), - _terminator(t), - _reset_terminator(reset_terminator) { - } - - void do_void() { - assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint"); - - ShenandoahHeap* sh = ShenandoahHeap::heap(); - ShenandoahTraversalGC* traversal_gc = sh->traversal_gc(); - assert(sh->process_references(), "why else would we be here?"); - shenandoah_assert_rp_isalive_installed(); - - traversal_gc->main_loop(_worker_id, _terminator, false); - - if (_reset_terminator) { - _terminator->reset_for_reuse(); - } - } -}; - -class ShenandoahTraversalSingleThreadedDrainMarkingStackClosure: public VoidClosure { - uint _worker_id; - ShenandoahTaskTerminator* _terminator; - bool _reset_terminator; - -public: - ShenandoahTraversalSingleThreadedDrainMarkingStackClosure(uint worker_id, ShenandoahTaskTerminator* t, bool reset_terminator = false): - _worker_id(worker_id), - _terminator(t), - _reset_terminator(reset_terminator) { - } - - void do_void() { - assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint"); - - ShenandoahHeap* sh = ShenandoahHeap::heap(); - ShenandoahTraversalGC* traversal_gc = sh->traversal_gc(); - assert(sh->process_references(), "why else would we be here?"); - shenandoah_assert_rp_isalive_installed(); - - traversal_gc->main_loop(_worker_id, _terminator, false); - - if (_reset_terminator) { - _terminator->reset_for_reuse(); - } - } -}; - -void ShenandoahTraversalGC::weak_refs_work() { - assert(_heap->process_references(), "sanity"); - - ShenandoahPhaseTimings::Phase phase_root = ShenandoahPhaseTimings::weakrefs; - - ShenandoahGCPhase phase(phase_root); - - ReferenceProcessor* rp = _heap->ref_processor(); - - // NOTE: We cannot shortcut on has_discovered_references() here, because - // we will miss marking JNI Weak refs then, see implementation in - // ReferenceProcessor::process_discovered_references. - weak_refs_work_doit(); - - rp->verify_no_references_recorded(); - assert(!rp->discovery_enabled(), "Post condition"); - -} - -class ShenandoahTraversalRefProcTaskProxy : public AbstractGangTask { -private: - AbstractRefProcTaskExecutor::ProcessTask& _proc_task; - ShenandoahTaskTerminator* _terminator; - -public: - ShenandoahTraversalRefProcTaskProxy(AbstractRefProcTaskExecutor::ProcessTask& proc_task, - ShenandoahTaskTerminator* t) : - AbstractGangTask("Process reference objects in parallel"), - _proc_task(proc_task), - _terminator(t) { - } - - void work(uint worker_id) { - assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint"); - ShenandoahHeap* heap = ShenandoahHeap::heap(); - ShenandoahTraversalDrainMarkingStackClosure complete_gc(worker_id, _terminator); - - ShenandoahForwardedIsAliveClosure is_alive; - if (!heap->is_degenerated_gc_in_progress()) { - ShenandoahTraversalKeepAliveUpdateClosure keep_alive(heap->traversal_gc()->task_queues()->queue(worker_id)); - _proc_task.work(worker_id, is_alive, keep_alive, complete_gc); - } else { - ShenandoahTraversalKeepAliveUpdateDegenClosure keep_alive(heap->traversal_gc()->task_queues()->queue(worker_id)); - _proc_task.work(worker_id, is_alive, keep_alive, complete_gc); - } - } -}; - -class ShenandoahTraversalRefProcTaskExecutor : public AbstractRefProcTaskExecutor { -private: - WorkGang* _workers; - -public: - ShenandoahTraversalRefProcTaskExecutor(WorkGang* workers) : _workers(workers) {} - - // Executes a task using worker threads. - void execute(ProcessTask& task, uint ergo_workers) { - assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint"); - - ShenandoahHeap* heap = ShenandoahHeap::heap(); - ShenandoahTraversalGC* traversal_gc = heap->traversal_gc(); - ShenandoahPushWorkerQueuesScope scope(_workers, - traversal_gc->task_queues(), - ergo_workers, - /* do_check = */ false); - uint nworkers = _workers->active_workers(); - traversal_gc->task_queues()->reserve(nworkers); - ShenandoahTaskTerminator terminator(nworkers, traversal_gc->task_queues()); - ShenandoahTraversalRefProcTaskProxy proc_task_proxy(task, &terminator); - _workers->run_task(&proc_task_proxy); - } -}; - -void ShenandoahTraversalGC::weak_refs_work_doit() { - ReferenceProcessor* rp = _heap->ref_processor(); - - ShenandoahPhaseTimings::Phase phase_process = ShenandoahPhaseTimings::weakrefs_process; - - shenandoah_assert_rp_isalive_not_installed(); - ShenandoahForwardedIsAliveClosure is_alive; - ReferenceProcessorIsAliveMutator fix_isalive(rp, &is_alive); - - WorkGang* workers = _heap->workers(); - uint nworkers = workers->active_workers(); - - rp->setup_policy(_heap->soft_ref_policy()->should_clear_all_soft_refs()); - rp->set_active_mt_degree(nworkers); - - assert(task_queues()->is_empty(), "Should be empty"); - - // complete_gc and keep_alive closures instantiated here are only needed for - // single-threaded path in RP. They share the queue 0 for tracking work, which - // simplifies implementation. Since RP may decide to call complete_gc several - // times, we need to be able to reuse the terminator. - uint serial_worker_id = 0; - ShenandoahTaskTerminator terminator(1, task_queues()); - ShenandoahTraversalSingleThreadedDrainMarkingStackClosure complete_gc(serial_worker_id, &terminator, /* reset_terminator = */ true); - ShenandoahPushWorkerQueuesScope scope(workers, task_queues(), 1, /* do_check = */ false); - - ShenandoahTraversalRefProcTaskExecutor executor(workers); - - ReferenceProcessorPhaseTimes pt(_heap->gc_timer(), rp->num_queues()); - if (!_heap->is_degenerated_gc_in_progress()) { - ShenandoahTraversalSingleThreadKeepAliveUpdateClosure keep_alive(task_queues()->queue(serial_worker_id)); - rp->process_discovered_references(&is_alive, &keep_alive, - &complete_gc, &executor, - &pt); - } else { - ShenandoahTraversalSingleThreadKeepAliveUpdateDegenClosure keep_alive(task_queues()->queue(serial_worker_id)); - rp->process_discovered_references(&is_alive, &keep_alive, - &complete_gc, &executor, - &pt); - } - - pt.print_all_references(); - assert(task_queues()->is_empty() || _heap->cancelled_gc(), "Should be empty"); -} diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.hpp b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.hpp deleted file mode 100644 index 34577bdc8d..0000000000 --- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_HPP -#define SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_HPP - -#include "memory/allocation.hpp" -#include "gc/shenandoah/shenandoahHeap.hpp" -#include "gc/shenandoah/shenandoahHeapRegionSet.hpp" -#include "gc/shenandoah/shenandoahTaskqueue.hpp" -#include "runtime/thread.hpp" - -class ShenandoahTraversalGC : public CHeapObj { -private: - ShenandoahHeap* const _heap; - ShenandoahObjToScanQueueSet* const _task_queues; - ShenandoahHeapRegionSet _traversal_set; - -public: - ShenandoahTraversalGC(ShenandoahHeap* heap, size_t num_regions); - ~ShenandoahTraversalGC(); - - ShenandoahHeapRegionSet* traversal_set() { return &_traversal_set; } - - void reset(); - void prepare(); - void init_traversal_collection(); - void concurrent_traversal_collection(); - void final_traversal_collection(); - - template - inline void process_oop(T* p, Thread* thread, ShenandoahObjToScanQueue* queue, ShenandoahMarkingContext* const mark_context); - - bool check_and_handle_cancelled_gc(ShenandoahTaskTerminator* terminator, bool sts_yield); - - ShenandoahObjToScanQueueSet* task_queues(); - - void main_loop(uint worker_id, ShenandoahTaskTerminator* terminator, bool sts_yield); - -private: - void prepare_regions(); - - template - void main_loop_work(T* cl, jushort* live_data, uint worker_id, ShenandoahTaskTerminator* terminator, bool sts_yield); - - void preclean_weak_refs(); - void weak_refs_work(); - void weak_refs_work_doit(); - - void fixup_roots(); - void verify_roots_after_gc(); -}; - -#endif // SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.inline.hpp deleted file mode 100644 index 86c36238dd..0000000000 --- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.inline.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_INLINE_HPP -#define SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_INLINE_HPP - -#include "gc/shenandoah/shenandoahAsserts.hpp" -#include "gc/shenandoah/shenandoahBarrierSet.inline.hpp" -#include "gc/shenandoah/shenandoahHeap.inline.hpp" -#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp" -#include "gc/shenandoah/shenandoahStringDedup.hpp" -#include "gc/shenandoah/shenandoahTraversalGC.hpp" -#include "gc/shenandoah/shenandoahTaskqueue.hpp" -#include "gc/shenandoah/shenandoahTaskqueue.inline.hpp" -#include "oops/compressedOops.inline.hpp" -#include "oops/oop.inline.hpp" - -template -void ShenandoahTraversalGC::process_oop(T* p, Thread* thread, ShenandoahObjToScanQueue* queue, ShenandoahMarkingContext* const mark_context) { - T o = RawAccess<>::oop_load(p); - if (!CompressedOops::is_null(o)) { - oop obj = CompressedOops::decode_not_null(o); - if (DEGEN) { - assert(!ATOMIC_UPDATE, "Degen path assumes non-atomic updates"); - oop forw = ShenandoahBarrierSet::resolve_forwarded_not_null(obj); - if (obj != forw) { - // Update reference. - RawAccess::oop_store(p, forw); - } - obj = forw; - } else if (_heap->in_collection_set(obj)) { - oop forw = ShenandoahBarrierSet::resolve_forwarded_not_null(obj); - if (obj == forw) { - ShenandoahEvacOOMScope evac_scope; - forw = _heap->evacuate_object(obj, thread); - } - shenandoah_assert_forwarded_except(p, obj, _heap->cancelled_gc()); - // Update reference. - if (ATOMIC_UPDATE) { - ShenandoahHeap::cas_oop(forw, p, obj); - } else { - RawAccess::oop_store(p, forw); - } - obj = forw; - } - - shenandoah_assert_not_forwarded(p, obj); - shenandoah_assert_not_in_cset_except(p, obj, _heap->cancelled_gc()); - - if (mark_context->mark(obj)) { - bool succeeded = queue->push(ShenandoahMarkTask(obj)); - assert(succeeded, "must succeed to push to task queue"); - - if (STRING_DEDUP && ShenandoahStringDedup::is_candidate(obj) && !_heap->cancelled_gc()) { - assert(ShenandoahStringDedup::is_enabled(), "Must be enabled"); - // Only dealing with to-space string, so that we can avoid evac-oom protocol, which is costly here. - shenandoah_assert_not_in_cset(p, obj); - ShenandoahStringDedup::enqueue_candidate(obj); - } - } - } -} - -#endif // SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_INLINE_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.cpp b/src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.cpp deleted file mode 100644 index fe43df418f..0000000000 --- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2019, Red Hat, Inc. All rights reserved. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "gc/shenandoah/shenandoahTraversalMode.hpp" -#include "gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.hpp" -#include "gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp" -#include "logging/log.hpp" -#include "logging/logTag.hpp" - -void ShenandoahTraversalMode::initialize_flags() const { - FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false); - FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, true); - FLAG_SET_DEFAULT(ShenandoahKeepAliveBarrier, false); - FLAG_SET_DEFAULT(ShenandoahAllowMixedAllocs, false); - - SHENANDOAH_ERGO_ENABLE_FLAG(ExplicitGCInvokesConcurrent); - SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahImplicitGCInvokesConcurrent); - - // Final configuration checks - SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier); - SHENANDOAH_CHECK_FLAG_SET(ShenandoahStoreValEnqueueBarrier); - SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier); - SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier); -} - -ShenandoahHeuristics* ShenandoahTraversalMode::initialize_heuristics() const { - if (ShenandoahGCHeuristics != NULL) { - if (strcmp(ShenandoahGCHeuristics, "adaptive") == 0) { - return new ShenandoahTraversalHeuristics(); - } else if (strcmp(ShenandoahGCHeuristics, "aggressive") == 0) { - return new ShenandoahTraversalAggressiveHeuristics(); - } else { - vm_exit_during_initialization("Unknown -XX:ShenandoahGCHeuristics option"); - } - } - ShouldNotReachHere(); - return NULL; -} diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.hpp b/src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.hpp deleted file mode 100644 index 9d3949f222..0000000000 --- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2019, Red Hat, Inc. All rights reserved. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALMODE_HPP -#define SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALMODE_HPP - -#include "gc/shenandoah/shenandoahMode.hpp" - -class ShenandoahHeuristics; - -class ShenandoahTraversalMode : public ShenandoahMode { -public: - virtual void initialize_flags() const; - virtual ShenandoahHeuristics* initialize_heuristics() const; -}; - -#endif // SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALMODE_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp b/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp index dfe221ce05..899ad47ed6 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp @@ -123,9 +123,6 @@ bool ShenandoahGCPhase::is_root_work_phase() { case ShenandoahPhaseTimings::init_evac: case ShenandoahPhaseTimings::final_update_refs_roots: case ShenandoahPhaseTimings::degen_gc_update_roots: - case ShenandoahPhaseTimings::init_traversal_gc_work: - case ShenandoahPhaseTimings::final_traversal_gc_work: - case ShenandoahPhaseTimings::final_traversal_update_roots: case ShenandoahPhaseTimings::full_gc_roots: return true; default: diff --git a/src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp b/src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp index d753e6b16a..8aa8c03bf8 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp @@ -107,8 +107,6 @@ public: VM_Operation::VMOp_Type type = vm_op->type(); return type == VM_Operation::VMOp_ShenandoahInitMark || type == VM_Operation::VMOp_ShenandoahFinalMarkStartEvac || - type == VM_Operation::VMOp_ShenandoahInitTraversalGC || - type == VM_Operation::VMOp_ShenandoahFinalTraversalGC || type == VM_Operation::VMOp_ShenandoahInitUpdateRefs || type == VM_Operation::VMOp_ShenandoahFinalUpdateRefs || type == VM_Operation::VMOp_ShenandoahFullGC || diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp b/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp index eb1674fdc3..1b7d59c05e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp @@ -60,16 +60,6 @@ void VM_ShenandoahDegeneratedGC::doit() { ShenandoahHeap::heap()->entry_degenerated(_point); } -void VM_ShenandoahInitTraversalGC::doit() { - ShenandoahGCPauseMark mark(_gc_id, SvcGCMarker::CONCURRENT); - ShenandoahHeap::heap()->entry_init_traversal(); -} - -void VM_ShenandoahFinalTraversalGC::doit() { - ShenandoahGCPauseMark mark(_gc_id, SvcGCMarker::CONCURRENT); - ShenandoahHeap::heap()->entry_final_traversal(); -} - void VM_ShenandoahInitUpdateRefs::doit() { ShenandoahGCPauseMark mark(_gc_id, SvcGCMarker::CONCURRENT); ShenandoahHeap::heap()->entry_init_updaterefs(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp b/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp index 3fdb469efd..eed238b600 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp @@ -35,8 +35,6 @@ // - VM_ShenandoahInitUpdateRefs: initiate update references // - VM_ShenandoahFinalUpdateRefs: finish up update references // - VM_ShenandoahFullGC: do full GC -// - VM_ShenandoahInitTraversalGC: init traversal GC -// - VM_ShenandoahFinalTraversalGC: finish traversal GC class VM_ShenandoahOperation : public VM_Operation { protected: @@ -90,22 +88,6 @@ public: virtual void doit(); }; -class VM_ShenandoahInitTraversalGC: public VM_ShenandoahOperation { -public: - VM_ShenandoahInitTraversalGC() : VM_ShenandoahOperation() {}; - VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahInitTraversalGC; } - const char* name() const { return "Shenandoah Init Traversal Collection"; } - virtual void doit(); -}; - -class VM_ShenandoahFinalTraversalGC: public VM_ShenandoahReferenceOperation { -public: - VM_ShenandoahFinalTraversalGC() : VM_ShenandoahReferenceOperation() {}; - VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalTraversalGC; } - const char* name() const { return "Shenandoah Final Traversal Collection"; } - virtual void doit(); -}; - class VM_ShenandoahInitUpdateRefs: public VM_ShenandoahOperation { public: VM_ShenandoahInitUpdateRefs() : VM_ShenandoahOperation() {}; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp index 5be7c001c9..db3cb35a20 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp @@ -870,30 +870,6 @@ void ShenandoahVerifier::verify_after_degenerated() { ); } -void ShenandoahVerifier::verify_before_traversal() { - verify_at_safepoint( - "Before Traversal", - _verify_forwarded_none, // cannot have forwarded objects - _verify_marked_disable, // bitmaps are not relevant before traversal - _verify_cset_none, // no cset references before traversal - _verify_liveness_disable, // no reliable liveness data anymore - _verify_regions_notrash_nocset, // no trash and no cset regions - _verify_gcstate_stable // nothing forwarded before traversal - ); -} - -void ShenandoahVerifier::verify_after_traversal() { - verify_at_safepoint( - "After Traversal", - _verify_forwarded_none, // cannot have forwarded objects - _verify_marked_complete, // should have complete marking after traversal - _verify_cset_none, // no cset references left after traversal - _verify_liveness_disable, // liveness data is not collected for new allocations - _verify_regions_nocset, // no cset regions, trash regions allowed - _verify_gcstate_stable // nothing forwarded after traversal - ); -} - void ShenandoahVerifier::verify_before_fullgc() { verify_at_safepoint( "Before Full GC", diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp index a371140876..acb44d16c1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp @@ -183,8 +183,6 @@ public: void verify_after_updaterefs(); void verify_before_fullgc(); void verify_after_fullgc(); - void verify_before_traversal(); - void verify_after_traversal(); void verify_after_degenerated(); void verify_generic(VerifyOption option); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp index 30710fbf35..bad49aba09 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp @@ -33,8 +33,6 @@ uint ShenandoahWorkerPolicy::_prev_conc_evac = 0; uint ShenandoahWorkerPolicy::_prev_conc_root_proc = 0; uint ShenandoahWorkerPolicy::_prev_fullgc = 0; uint ShenandoahWorkerPolicy::_prev_degengc = 0; -uint ShenandoahWorkerPolicy::_prev_stw_traversal = 0; -uint ShenandoahWorkerPolicy::_prev_conc_traversal = 0; uint ShenandoahWorkerPolicy::_prev_conc_update_ref = 0; uint ShenandoahWorkerPolicy::_prev_par_update_ref = 0; uint ShenandoahWorkerPolicy::_prev_conc_cleanup = 0; @@ -104,26 +102,6 @@ uint ShenandoahWorkerPolicy::calc_workers_for_stw_degenerated() { return _prev_degengc; } -// Calculate workers for Stop-the-world traversal GC -uint ShenandoahWorkerPolicy::calc_workers_for_stw_traversal() { - uint active_workers = (_prev_stw_traversal == 0) ? ParallelGCThreads : _prev_stw_traversal; - _prev_stw_traversal = - WorkerPolicy::calc_active_workers(ParallelGCThreads, - active_workers, - Threads::number_of_non_daemon_threads()); - return _prev_stw_traversal; -} - -// Calculate workers for concurent traversal GC -uint ShenandoahWorkerPolicy::calc_workers_for_conc_traversal() { - uint active_workers = (_prev_conc_traversal == 0) ? ConcGCThreads : _prev_conc_traversal; - _prev_conc_traversal = - WorkerPolicy::calc_active_conc_workers(ConcGCThreads, - active_workers, - Threads::number_of_non_daemon_threads()); - return _prev_conc_traversal; -} - // Calculate workers for concurrent reference update uint ShenandoahWorkerPolicy::calc_workers_for_conc_update_ref() { uint active_workers = (_prev_conc_update_ref == 0) ? ConcGCThreads : _prev_conc_update_ref; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp index 270f3abb9b..4117c50c9d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp @@ -34,8 +34,6 @@ private: static uint _prev_conc_evac; static uint _prev_fullgc; static uint _prev_degengc; - static uint _prev_stw_traversal; - static uint _prev_conc_traversal; static uint _prev_conc_update_ref; static uint _prev_par_update_ref; static uint _prev_conc_cleanup; @@ -63,12 +61,6 @@ public: // Calculate workers for parallel degenerated gc static uint calc_workers_for_stw_degenerated(); - // Calculate workers for Stop-the-world traversal GC - static uint calc_workers_for_stw_traversal(); - - // Calculate workers for concurrent traversal GC - static uint calc_workers_for_conc_traversal(); - // Calculate workers for concurrent reference update static uint calc_workers_for_conc_update_ref(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp index f1aab16476..a6a3c95bd9 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp @@ -66,7 +66,6 @@ "GC mode to use. Among other things, this defines which " \ "barriers are in in use. Possible values are:" \ " normal - default concurrent GC (three pass mark-evac-update);" \ - " traversal - traversal concurrent GC (single-pass); " \ " passive - stop the world GC only (either degenerated or full)") \ \ experimental(ccstr, ShenandoahGCHeuristics, "adaptive", \ diff --git a/src/hotspot/share/runtime/vmOperations.hpp b/src/hotspot/share/runtime/vmOperations.hpp index 6ea4a2ac69..04195704d4 100644 --- a/src/hotspot/share/runtime/vmOperations.hpp +++ b/src/hotspot/share/runtime/vmOperations.hpp @@ -102,8 +102,6 @@ template(ShenandoahFullGC) \ template(ShenandoahInitMark) \ template(ShenandoahFinalMarkStartEvac) \ - template(ShenandoahInitTraversalGC) \ - template(ShenandoahFinalTraversalGC) \ template(ShenandoahInitUpdateRefs) \ template(ShenandoahFinalUpdateRefs) \ template(ShenandoahDegeneratedGC) \ diff --git a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java index c5f1fcf84e..f51d6151aa 100644 --- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java +++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java @@ -38,8 +38,7 @@ * and in {G1, * Serial, * Parallel, - * Shenandoah, - * ShenandoahTraversal} + * Shenandoah} */ @@ -94,13 +93,6 @@ public class TestVolatiles { procArgs[argcount - 3] = "-XX:+UnlockExperimentalVMOptions"; procArgs[argcount - 2] = "-XX:+UseShenandoahGC"; break; - case "ShenandoahTraversal": - argcount = 11; - procArgs = new String[argcount]; - procArgs[argcount - 4] = "-XX:+UnlockExperimentalVMOptions"; - procArgs[argcount - 3] = "-XX:+UseShenandoahGC"; - procArgs[argcount - 2] = "-XX:ShenandoahGCMode=traversal"; - break; default: throw new RuntimeException("unexpected test type " + testType); } @@ -331,7 +323,6 @@ public class TestVolatiles { }; break; case "Shenandoah": - case "ShenandoahTraversal": // Shenandoah generates normal object graphs for // volatile stores matches = new String[] { @@ -410,7 +401,6 @@ public class TestVolatiles { break; case "Shenandoah": - case "ShenandoahTraversal": // Shenandoah generates normal object graphs for // volatile stores matches = new String[] { @@ -500,7 +490,6 @@ public class TestVolatiles { }; break; case "Shenandoah": - case "ShenandoahTraversal": // For volatile CAS, Shenanodoah generates normal // graphs with a shenandoah-specific cmpxchg matches = new String[] { @@ -578,7 +567,6 @@ public class TestVolatiles { }; break; case "Shenandoah": - case "ShenandoahTraversal": // For volatile CAS, Shenanodoah generates normal // graphs with a shenandoah-specific cmpxchg matches = new String[] { @@ -684,7 +672,6 @@ public class TestVolatiles { }; break; case "Shenandoah": - case "ShenandoahTraversal": // For volatile CAS, Shenanodoah generates normal // graphs with a shenandoah-specific cmpxchg matches = new String[] { @@ -762,7 +749,6 @@ public class TestVolatiles { }; break; case "Shenandoah": - case "ShenandoahTraversal": // For volatile CAS, Shenanodoah generates normal // graphs with a shenandoah-specific cmpxchg matches = new String[] { @@ -848,7 +834,6 @@ public class TestVolatiles { }; break; case "Shenandoah": - case "ShenandoahTraversal": matches = new String[] { "membar_release \\(elided\\)", useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq", @@ -924,7 +909,6 @@ public class TestVolatiles { }; break; case "Shenandoah": - case "ShenandoahTraversal": matches = new String[] { "membar_release", "dmb ish", diff --git a/test/hotspot/jtreg/gc/CriticalNativeArgs.java b/test/hotspot/jtreg/gc/CriticalNativeArgs.java index 52f0ecda30..8232b47242 100644 --- a/test/hotspot/jtreg/gc/CriticalNativeArgs.java +++ b/test/hotspot/jtreg/gc/CriticalNativeArgs.java @@ -46,8 +46,6 @@ package gc; * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.CriticalNativeArgs * * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives gc.CriticalNativeArgs - * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCMode=traversal -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.CriticalNativeArgs - * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.CriticalNativeArgs */ public class CriticalNativeArgs { public static void main(String[] args) { diff --git a/test/hotspot/jtreg/gc/shenandoah/TestAllocHumongousFragment.java b/test/hotspot/jtreg/gc/shenandoah/TestAllocHumongousFragment.java index a751dcc90b..6ffafc363b 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestAllocHumongousFragment.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestAllocHumongousFragment.java @@ -92,42 +92,6 @@ * TestAllocHumongousFragment */ -/* - * @test TestAllocHumongousFragment - * @summary Make sure Shenandoah can recover from humongous allocation fragmentation - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048 - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify - * TestAllocHumongousFragment - * - * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048 - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify - * TestAllocHumongousFragment - * - * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048 - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot - * TestAllocHumongousFragment - * - * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048 - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot - * TestAllocHumongousFragment - * - * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048 - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * TestAllocHumongousFragment - * - * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048 - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestAllocHumongousFragment - */ - import java.util.*; import java.util.concurrent.*; diff --git a/test/hotspot/jtreg/gc/shenandoah/TestAllocIntArrays.java b/test/hotspot/jtreg/gc/shenandoah/TestAllocIntArrays.java index a5c95d0519..e8234c929c 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestAllocIntArrays.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestAllocIntArrays.java @@ -101,46 +101,6 @@ * TestAllocIntArrays */ -/* - * @test TestAllocIntArrays - * @summary Acceptance tests: collector can withstand allocation - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify - * TestAllocIntArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify - * TestAllocIntArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot - * TestAllocIntArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot - * TestAllocIntArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * TestAllocIntArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * TestAllocIntArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestAllocIntArrays - */ - import java.util.Random; public class TestAllocIntArrays { diff --git a/test/hotspot/jtreg/gc/shenandoah/TestAllocObjectArrays.java b/test/hotspot/jtreg/gc/shenandoah/TestAllocObjectArrays.java index 26541be21c..5e39249fe3 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestAllocObjectArrays.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestAllocObjectArrays.java @@ -100,46 +100,6 @@ * TestAllocObjectArrays */ -/* - * @test TestAllocObjectArrays - * @summary Acceptance tests: collector can withstand allocation - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify - * TestAllocObjectArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify - * TestAllocObjectArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot - * TestAllocObjectArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot - * TestAllocObjectArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * TestAllocObjectArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * TestAllocObjectArrays - * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestAllocObjectArrays - */ - import java.util.Random; public class TestAllocObjectArrays { diff --git a/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java b/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java index d91eeb5bac..d402bb70fe 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java @@ -116,51 +116,6 @@ * TestAllocObjects */ -/* - * @test TestAllocObjects - * @summary Acceptance tests: collector can withstand allocation - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify - * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify - * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot - * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot - * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestAllocObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahSuspendibleWorkers - * TestAllocObjects - */ - import java.util.Random; public class TestAllocObjects { diff --git a/test/hotspot/jtreg/gc/shenandoah/TestGCThreadGroups.java b/test/hotspot/jtreg/gc/shenandoah/TestGCThreadGroups.java index a40adf78b6..65754bcdd0 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestGCThreadGroups.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestGCThreadGroups.java @@ -83,25 +83,6 @@ * TestGCThreadGroups */ -/** - * @test TestGCThreadGroups - * @summary Test Shenandoah GC uses concurrent/parallel threads correctly - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4 - * -Dtarget=1000 - * TestGCThreadGroups - * - * @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4 - * -Dtarget=1000 - * TestGCThreadGroups -*/ - public class TestGCThreadGroups { static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation, around 1K cycles to handle diff --git a/test/hotspot/jtreg/gc/shenandoah/TestHeapUncommit.java b/test/hotspot/jtreg/gc/shenandoah/TestHeapUncommit.java index 94ef575cec..b1ab39df9d 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestHeapUncommit.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestHeapUncommit.java @@ -81,26 +81,6 @@ * TestHeapUncommit */ -/* - * @test TestHeapUncommit - * @summary Acceptance tests: collector can withstand allocation - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahUncommit -XX:ShenandoahUncommitDelay=0 - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * TestHeapUncommit - * - * @run main/othervm -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahUncommit -XX:ShenandoahUncommitDelay=0 - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestHeapUncommit - * - * @run main/othervm -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahUncommit -XX:ShenandoahUncommitDelay=0 - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * TestHeapUncommit - */ - /* * @test TestHeapUncommit * @key gc diff --git a/test/hotspot/jtreg/gc/shenandoah/TestLotsOfCycles.java b/test/hotspot/jtreg/gc/shenandoah/TestLotsOfCycles.java index 6636da3edf..2014349bdc 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestLotsOfCycles.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestLotsOfCycles.java @@ -77,34 +77,6 @@ * TestLotsOfCycles */ -/* - * @test TestLotsOfCycles - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot - * -Dtarget=1000 - * TestLotsOfCycles - * - * @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot - * -Dtarget=1000 - * TestLotsOfCycles - * - * @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -Dtarget=1000 - * TestLotsOfCycles - * - * @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -Dtarget=10000 - * TestLotsOfCycles - */ - public class TestLotsOfCycles { static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation, around 1K cycles to handle diff --git a/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java b/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java index 11126379b5..8fccc7f10f 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestObjItrWithHeapDump.java @@ -57,7 +57,6 @@ public class TestObjItrWithHeapDump { String[][][] modeHeuristics = new String[][][] { {{"normal"}, {"adaptive", "compact", "static", "aggressive"}}, - {{"traversal"}, {"adaptive", "aggressive"}}, {{"passive"}, {"passive"}} }; diff --git a/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java b/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java index ed57cb4cc6..e4b094e38a 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestPeriodicGC.java @@ -98,36 +98,6 @@ public class TestPeriodicGC { ); } - testWith("Zero interval with traversal mode", - false, - "-Xlog:gc", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+UnlockExperimentalVMOptions", - "-XX:+UseShenandoahGC", - "-XX:ShenandoahGCMode=traversal", - "-XX:ShenandoahGuaranteedGCInterval=0" - ); - - testWith("Short interval with traversal mode", - true, - "-Xlog:gc", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+UnlockExperimentalVMOptions", - "-XX:+UseShenandoahGC", - "-XX:ShenandoahGCMode=traversal", - "-XX:ShenandoahGuaranteedGCInterval=1000" - ); - - testWith("Long interval with traversal mode", - false, - "-Xlog:gc", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+UnlockExperimentalVMOptions", - "-XX:+UseShenandoahGC", - "-XX:ShenandoahGCMode=traversal", - "-XX:ShenandoahGuaranteedGCInterval=100000" // deliberately too long - ); - testWith("Short interval with aggressive", false, "-Xlog:gc", diff --git a/test/hotspot/jtreg/gc/shenandoah/TestRefprocSanity.java b/test/hotspot/jtreg/gc/shenandoah/TestRefprocSanity.java index 193add2a05..850810e337 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestRefprocSanity.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestRefprocSanity.java @@ -41,26 +41,6 @@ * TestRefprocSanity */ -/* - * @test TestRefprocSanity - * @summary Test that null references/referents work fine - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * TestRefprocSanity - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestRefprocSanity - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * TestRefprocSanity - */ - import java.lang.ref.*; public class TestRefprocSanity { diff --git a/test/hotspot/jtreg/gc/shenandoah/TestRegionSampling.java b/test/hotspot/jtreg/gc/shenandoah/TestRegionSampling.java index 96d410531c..16b21fe3ee 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestRegionSampling.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestRegionSampling.java @@ -57,20 +57,6 @@ * TestRegionSampling */ -/* - * @test TestRegionSampling - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * TestRegionSampling - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestRegionSampling - * - */ - public class TestRegionSampling { static final long TARGET_MB = Long.getLong("target", 2_000); // 2 Gb allocation diff --git a/test/hotspot/jtreg/gc/shenandoah/TestRetainObjects.java b/test/hotspot/jtreg/gc/shenandoah/TestRetainObjects.java index 177b756416..41a91c63f4 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestRetainObjects.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestRetainObjects.java @@ -91,36 +91,6 @@ * TestRetainObjects */ -/* - * @test TestRetainObjects - * @summary Acceptance tests: collector can deal with retained objects - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot - * TestRetainObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot - * TestRetainObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * TestRetainObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * TestRetainObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestRetainObjects - */ - public class TestRetainObjects { static final int COUNT = 10_000_000; diff --git a/test/hotspot/jtreg/gc/shenandoah/TestSieveObjects.java b/test/hotspot/jtreg/gc/shenandoah/TestSieveObjects.java index f26d13ef26..7eaf4698d0 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestSieveObjects.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestSieveObjects.java @@ -91,36 +91,6 @@ * TestSieveObjects */ -/* - * @test TestSieveObjects - * @summary Acceptance tests: collector can deal with retained objects - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot - * TestSieveObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot - * TestSieveObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * TestSieveObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * TestSieveObjects - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestSieveObjects - */ - import java.util.concurrent.ThreadLocalRandom; public class TestSieveObjects { diff --git a/test/hotspot/jtreg/gc/shenandoah/TestStringDedup.java b/test/hotspot/jtreg/gc/shenandoah/TestStringDedup.java index 2b13df0d52..d9b4f16de8 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestStringDedup.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestStringDedup.java @@ -65,25 +65,6 @@ * TestStringDedup */ -/* - * @test TestStringDedup - * @summary Test Shenandoah string deduplication implementation - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * @library /test/lib - * @modules java.base/jdk.internal.misc:open - * @modules java.base/java.lang:open - * java.management - * - * @run main/othervm -Xmx256m -Xlog:gc+stats -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestStringDedup - * - * @run main/othervm -Xmx256m -Xlog:gc+stats -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * TestStringDedup - */ - import java.lang.reflect.*; import java.util.*; diff --git a/test/hotspot/jtreg/gc/shenandoah/TestStringDedupStress.java b/test/hotspot/jtreg/gc/shenandoah/TestStringDedupStress.java index 4c98240178..a1d04e7150 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestStringDedupStress.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestStringDedupStress.java @@ -73,38 +73,6 @@ * TestStringDedupStress */ - /* - * @test TestStringDedupStress - * @summary Test Shenandoah string deduplication implementation - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * @library /test/lib - * @modules java.base/jdk.internal.misc:open - * @modules java.base/java.lang:open - * java.management - * - * @run main/othervm -Xmx1g -Xlog:gc+stats -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestStringDedupStress - * - * @run main/othervm -Xmx1g -Xlog:gc+stats -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -DtargetStrings=2000000 - * TestStringDedupStress - * - * @run main/othervm -Xmx1g -Xlog:gc+stats -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahOOMDuringEvacALot - * -DtargetStrings=2000000 - * TestStringDedupStress - * - * @run main/othervm -Xmx1g -Xlog:gc+stats -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot - * -DtargetStrings=2000000 - * TestStringDedupStress - */ - import java.lang.management.*; import java.lang.reflect.*; import java.util.*; diff --git a/test/hotspot/jtreg/gc/shenandoah/TestStringInternCleanup.java b/test/hotspot/jtreg/gc/shenandoah/TestStringInternCleanup.java index ebcf1ae892..75cf7e28ee 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestStringInternCleanup.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestStringInternCleanup.java @@ -76,27 +76,6 @@ * TestStringInternCleanup */ -/* - * @test TestStringInternCleanup - * @summary Check that Shenandoah cleans up interned strings - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xmx64m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ClassUnloadingWithConcurrentMark - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * TestStringInternCleanup - * - * @run main/othervm -Xmx64m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ClassUnloadingWithConcurrentMark - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahVerify - * TestStringInternCleanup - * - * @run main/othervm -Xmx64m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ClassUnloadingWithConcurrentMark - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestStringInternCleanup - */ - public class TestStringInternCleanup { static final int COUNT = 1_000_000; diff --git a/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java b/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java index 8a60546cf1..646c843e74 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java @@ -59,20 +59,6 @@ * TestVerifyJCStress */ -/* - * @test TestVerifyJCStress - * @summary Tests that we pass at least one jcstress-like test with all verification turned on - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * @modules java.base/jdk.internal.misc - * java.management - * - * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify -XX:+IgnoreUnrecognizedVMOptions -XX:+ShenandoahVerifyOptoBarriers - * TestVerifyJCStress - */ - import java.util.*; import java.util.concurrent.*; import java.util.concurrent.locks.*; diff --git a/test/hotspot/jtreg/gc/shenandoah/TestWrongArrayMember.java b/test/hotspot/jtreg/gc/shenandoah/TestWrongArrayMember.java index 024a8e44af..1029a88175 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestWrongArrayMember.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestWrongArrayMember.java @@ -27,7 +27,6 @@ * @requires vm.gc.Shenandoah & !vm.graal.enabled * * @run main/othervm -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC TestWrongArrayMember - * @run main/othervm -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal TestWrongArrayMember */ public class TestWrongArrayMember { diff --git a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java index bd2bd11361..899827879e 100644 --- a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java +++ b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java @@ -63,22 +63,6 @@ * TestChurnNotifications */ -/* - * @test TestChurnNotifications - * @summary Check that MX notifications are reported for all cycles - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -Dprecise=false - * TestChurnNotifications - * - * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -Dprecise=false - * TestChurnNotifications - */ - import java.util.*; import java.util.concurrent.atomic.*; import javax.management.*; diff --git a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java index 6897dd31d5..65bdd286b5 100644 --- a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java +++ b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java @@ -61,21 +61,6 @@ * TestPauseNotifications */ -/* - * @test TestPauseNotifications - * @summary Check that MX notifications are reported for all cycles - * @key gc - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * - * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * TestPauseNotifications - * - * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * TestPauseNotifications - */ - import java.util.*; import java.util.concurrent.atomic.*; import javax.management.*; diff --git a/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java b/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java index ef4825b4e1..24f33731b4 100644 --- a/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java +++ b/test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java @@ -126,7 +126,6 @@ public class TestClassLoaderLeak { String[][][] modeHeuristics = new String[][][] { {{"normal"}, {"adaptive", "compact", "static", "aggressive"}}, - {{"traversal"}, {"adaptive", "aggressive"}}, {{"passive"}, {"passive"}} }; diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java b/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java index 0253cfd488..b283e24dcc 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java @@ -59,11 +59,6 @@ public class TestExplicitGC { "Pause Final Mark", }; - String[] concTraversal = new String[] { - "Pause Init Traversal", - "Pause Final Traversal", - }; - { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", @@ -78,9 +73,6 @@ public class TestExplicitGC { for (String p : concNormal) { output.shouldContain(p); } - for (String p : concTraversal) { - output.shouldNotContain(p); - } } { @@ -98,9 +90,6 @@ public class TestExplicitGC { for (String p : concNormal) { output.shouldNotContain(p); } - for (String p : concTraversal) { - output.shouldNotContain(p); - } } { @@ -118,30 +107,6 @@ public class TestExplicitGC { for (String p : concNormal) { output.shouldContain(p); } - for (String p : concTraversal) { - output.shouldNotContain(p); - } - } - - { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockExperimentalVMOptions", - "-XX:+UseShenandoahGC", - "-Xlog:gc", - "-XX:+ExplicitGCInvokesConcurrent", - "-XX:ShenandoahGCMode=traversal", - TestExplicitGC.class.getName(), - "test"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - for (String p : full) { - output.shouldNotContain(p); - } - for (String p : concNormal) { - output.shouldNotContain(p); - } - for (String p : concTraversal) { - output.shouldContain(p); - } } { @@ -159,9 +124,6 @@ public class TestExplicitGC { for (String p : concNormal) { output.shouldNotContain(p); } - for (String p : concTraversal) { - output.shouldNotContain(p); - } } } } diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java b/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java index e2fc8752a7..3e0a5af706 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestHeuristicsUnlock.java @@ -48,8 +48,6 @@ public class TestHeuristicsUnlock { testWith("-XX:ShenandoahGCHeuristics=static", Mode.PRODUCT); testWith("-XX:ShenandoahGCHeuristics=compact", Mode.PRODUCT); - testWith("-XX:ShenandoahGCMode=traversal", Mode.PRODUCT); - testWith("-XX:ShenandoahGCHeuristics=aggressive", Mode.DIAGNOSTIC); testWith("-XX:ShenandoahGCHeuristics=passive", Mode.DIAGNOSTIC); } diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java b/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java index c5010f1f70..4640c4b333 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java @@ -44,7 +44,7 @@ public class TestSelectiveBarrierFlags { String[][] opts = { new String[] { "ShenandoahKeepAliveBarrier" }, new String[] { "ShenandoahLoadRefBarrier" }, - new String[] { "ShenandoahSATBBarrier", "ShenandoahStoreValEnqueueBarrier" }, + new String[] { "ShenandoahSATBBarrier" }, new String[] { "ShenandoahCASBarrier" }, new String[] { "ShenandoahCloneBarrier" }, }; diff --git a/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java b/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java index 382cb9eb50..c13c433a0d 100644 --- a/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java +++ b/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java @@ -45,19 +45,11 @@ public class TestWrongBarrierDisable { "ShenandoahKeepAliveBarrier", }; - String[] traversal = { - "ShenandoahLoadRefBarrier", - "ShenandoahCASBarrier", - "ShenandoahCloneBarrier", - }; - shouldFailAll("-XX:ShenandoahGCHeuristics=adaptive", concurrent); shouldFailAll("-XX:ShenandoahGCHeuristics=static", concurrent); shouldFailAll("-XX:ShenandoahGCHeuristics=compact", concurrent); shouldFailAll("-XX:ShenandoahGCHeuristics=aggressive", concurrent); - shouldFailAll("-XX:ShenandoahGCMode=traversal", traversal); shouldPassAll("-XX:ShenandoahGCMode=passive", concurrent); - shouldPassAll("-XX:ShenandoahGCMode=passive", traversal); } private static void shouldFailAll(String h, String[] barriers) throws Exception { diff --git a/test/hotspot/jtreg/gc/stress/CriticalNativeStress.java b/test/hotspot/jtreg/gc/stress/CriticalNativeStress.java index d38699725d..afbe682b7a 100644 --- a/test/hotspot/jtreg/gc/stress/CriticalNativeStress.java +++ b/test/hotspot/jtreg/gc/stress/CriticalNativeStress.java @@ -48,8 +48,6 @@ import gc.CriticalNative; * * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress - * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress - * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress */ public class CriticalNativeStress { private static Random rand = new Random(); diff --git a/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithShenandoah.java b/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithShenandoah.java index 25feb3e825..261cd8aca1 100644 --- a/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithShenandoah.java +++ b/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithShenandoah.java @@ -91,49 +91,6 @@ import java.io.IOException; * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact * gc.stress.gcbasher.TestGCBasherWithShenandoah 120000 */ - -/* - * @test TestGCBasherWithShenandoah - * @key gc - * @key stress - * @library / - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * @requires vm.flavor == "server" & !vm.emulatedClient & !vm.graal.enabled - * @summary Stress the Shenandoah GC by trying to make old objects more likely to be garbage than young objects. - * - * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot - * gc.stress.gcbasher.TestGCBasherWithShenandoah 120000 - * - * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot - * gc.stress.gcbasher.TestGCBasherWithShenandoah 120000 - * - * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * gc.stress.gcbasher.TestGCBasherWithShenandoah 120000 - */ - -/* - * @test TestGCBasherWithShenandoah - * @key gc - * @key stress - * @library / - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * @requires vm.flavor == "server" & !vm.emulatedClient & !vm.graal.enabled - * @summary Stress the Shenandoah GC by trying to make old objects more likely to be garbage than young objects. - * - * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * gc.stress.gcbasher.TestGCBasherWithShenandoah 120000 - * - * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * gc.stress.gcbasher.TestGCBasherWithShenandoah 120000 - */ public class TestGCBasherWithShenandoah { public static void main(String[] args) throws IOException { TestGCBasher.main(args); diff --git a/test/hotspot/jtreg/gc/stress/gcold/TestGCOldWithShenandoah.java b/test/hotspot/jtreg/gc/stress/gcold/TestGCOldWithShenandoah.java index 865832ec8a..8c6df3abd4 100644 --- a/test/hotspot/jtreg/gc/stress/gcold/TestGCOldWithShenandoah.java +++ b/test/hotspot/jtreg/gc/stress/gcold/TestGCOldWithShenandoah.java @@ -88,38 +88,6 @@ package gc.stress.gcold; * gc.stress.gcold.TestGCOld 50 1 20 10 10000 */ -/* - * @test TestGCOldWithShenandoah - * @key gc - * @key stress - * @library / - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * @summary Stress the GC by trying to make old objects more likely to be garbage than young objects. - * - * @run main/othervm -Xmx384M -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahOOMDuringEvacALot - * gc.stress.gcold.TestGCOld 50 1 20 10 10000 - * - * @run main/othervm -Xmx384M -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * -XX:+ShenandoahAllocFailureALot - * gc.stress.gcold.TestGCOld 50 1 20 10 10000 - * - * @run main/othervm -Xmx384M -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive - * gc.stress.gcold.TestGCOld 50 1 20 10 10000 - * - * @run main/othervm/timeout=600 -Xmx384M -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * gc.stress.gcold.TestGCOld 50 1 20 10 10000 - * - * @run main/othervm -Xmx384M -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * gc.stress.gcold.TestGCOld 50 1 20 10 10000 - */ - public class TestGCOldWithShenandoah { public static void main(String[] args) { diff --git a/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithShenandoah.java b/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithShenandoah.java index 7b542090cf..417be0bb1e 100644 --- a/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithShenandoah.java +++ b/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithShenandoah.java @@ -41,21 +41,6 @@ package gc.stress.systemgc; * -XX:+UseShenandoahGC * gc.stress.systemgc.TestSystemGCWithShenandoah 270 */ - -/* - * @test TestSystemGCWithShenandoah - * @key gc - * @key stress - * @library / - * @requires vm.gc.Shenandoah & !vm.graal.enabled - * @summary Stress the Shenandoah GC full GC by allocating objects of different lifetimes concurrently with System.gc(). - * - * @run main/othervm/timeout=300 -Xlog:gc*=info -Xmx512m -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions - * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal - * -XX:+ShenandoahVerify - * gc.stress.systemgc.TestSystemGCWithShenandoah 270 - * - */ public class TestSystemGCWithShenandoah { public static void main(String[] args) throws Exception { TestSystemGC.main(args);