Skip to content

Commit 79f9d8d

Browse files
author
Y. Srinivas Ramakrishna
committed
8350050: Shenandoah: Disable and purge allocation pacing support
Reviewed-by: wkemper, shade, kdnilsen
1 parent 4994bd5 commit 79f9d8d

20 files changed

+7
-786
lines changed

src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ void ShenandoahPassiveMode::initialize_flags() const {
3636
FLAG_SET_DEFAULT(ExplicitGCInvokesConcurrent, false);
3737
FLAG_SET_DEFAULT(ShenandoahImplicitGCInvokesConcurrent, false);
3838

39-
// Passive runs with max speed for allocation, because GC is always STW
40-
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahPacing);
41-
4239
// No need for evacuation reserve with Full GC, only for Degenerated GC.
4340
if (!ShenandoahDegeneratedGC) {
4441
SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahEvacReserve, 0);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ bool ShenandoahCollectorPolicy::should_handle_requested_gc(GCCause::Cause cause)
192192
void ShenandoahCollectorPolicy::print_gc_stats(outputStream* out) const {
193193
out->print_cr("Under allocation pressure, concurrent cycles may cancel, and either continue cycle");
194194
out->print_cr("under stop-the-world pause or result in stop-the-world Full GC. Increase heap size,");
195-
out->print_cr("tune GC heuristics, set more aggressive pacing delay, or lower allocation rate");
195+
out->print_cr("tune GC heuristics, or lower allocation rate");
196196
out->print_cr("to avoid Degenerated and Full GC cycles. Abbreviated cycles are those which found");
197197
out->print_cr("enough regions with no live objects to skip evacuation.");
198198
out->cr();

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ bool ShenandoahConcurrentGC::collect(GCCause::Cause cause) {
205205
entry_concurrent_update_refs_prepare(heap);
206206

207207
// Perform update-refs phase.
208-
if (ShenandoahVerify || ShenandoahPacing) {
208+
if (ShenandoahVerify) {
209209
vmop_entry_init_update_refs();
210210
}
211211

@@ -629,9 +629,7 @@ void ShenandoahConcurrentGC::entry_reset_after_collect() {
629629

630630
void ShenandoahConcurrentGC::op_reset() {
631631
ShenandoahHeap* const heap = ShenandoahHeap::heap();
632-
if (ShenandoahPacing) {
633-
heap->pacer()->setup_for_reset();
634-
}
632+
635633
// If it is old GC bootstrap cycle, always clear bitmap for global gen
636634
// to ensure bitmap for old gen is clear for old GC cycle after this.
637635
if (_do_old_gc_bootstrap) {
@@ -743,9 +741,6 @@ void ShenandoahConcurrentGC::op_init_mark() {
743741
ShenandoahCodeRoots::arm_nmethods_for_mark();
744742

745743
ShenandoahStackWatermark::change_epoch_id();
746-
if (ShenandoahPacing) {
747-
heap->pacer()->setup_for_mark();
748-
}
749744

750745
{
751746
ShenandoahTimingsTracker timing(ShenandoahPhaseTimings::init_propagate_gc_state);
@@ -806,9 +801,6 @@ void ShenandoahConcurrentGC::op_final_mark() {
806801
ShenandoahCodeRoots::arm_nmethods_for_evac();
807802
ShenandoahStackWatermark::change_epoch_id();
808803

809-
if (ShenandoahPacing) {
810-
heap->pacer()->setup_for_evac();
811-
}
812804
} else {
813805
if (ShenandoahVerify) {
814806
ShenandoahTimingsTracker v(ShenandoahPhaseTimings::final_mark_verify);
@@ -1136,9 +1128,6 @@ void ShenandoahConcurrentGC::op_init_update_refs() {
11361128
ShenandoahTimingsTracker v(ShenandoahPhaseTimings::init_update_refs_verify);
11371129
heap->verifier()->verify_before_update_refs();
11381130
}
1139-
if (ShenandoahPacing) {
1140-
heap->pacer()->setup_for_update_refs();
1141-
}
11421131
}
11431132

11441133
void ShenandoahConcurrentGC::op_update_refs() {

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "gc/shenandoah/shenandoahGeneration.hpp"
3535
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
3636
#include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
37-
#include "gc/shenandoah/shenandoahPacer.inline.hpp"
3837
#include "gc/shenandoah/shenandoahUtils.hpp"
3938
#include "logging/log.hpp"
4039
#include "memory/metaspaceStats.hpp"
@@ -69,9 +68,6 @@ void ShenandoahControlThread::run_service() {
6968
const bool is_gc_requested = _gc_requested.is_set();
7069
const GCCause::Cause requested_gc_cause = _requested_gc_cause;
7170

72-
// This control loop iteration has seen this much allocation.
73-
const size_t allocs_seen = reset_allocs_seen();
74-
7571
// Choose which GC mode to run in. The block below should select a single mode.
7672
GCMode mode = none;
7773
GCCause::Cause cause = GCCause::_last_gc_cause;
@@ -204,9 +200,6 @@ void ShenandoahControlThread::run_service() {
204200

205201
// Commit worker statistics to cycle data
206202
heap->phase_timings()->flush_par_workers_to_cycle();
207-
if (ShenandoahPacing) {
208-
heap->pacer()->flush_stats_to_cycle();
209-
}
210203

211204
// Print GC stats for current cycle
212205
{
@@ -215,9 +208,6 @@ void ShenandoahControlThread::run_service() {
215208
ResourceMark rm;
216209
LogStream ls(lt);
217210
heap->phase_timings()->print_cycle_on(&ls);
218-
if (ShenandoahPacing) {
219-
heap->pacer()->print_cycle_on(&ls);
220-
}
221211
}
222212
}
223213

@@ -226,16 +216,6 @@ void ShenandoahControlThread::run_service() {
226216

227217
// Print Metaspace change following GC (if logging is enabled).
228218
MetaspaceUtils::print_metaspace_change(meta_sizes);
229-
230-
// GC is over, we are at idle now
231-
if (ShenandoahPacing) {
232-
heap->pacer()->setup_for_idle();
233-
}
234-
} else {
235-
// Report to pacer that we have seen this many words allocated
236-
if (ShenandoahPacing && (allocs_seen > 0)) {
237-
heap->pacer()->report_alloc(allocs_seen);
238-
}
239219
}
240220

241221
// Check if we have seen a new target for soft max heap size or if a gc was requested.

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@
2929
#include "gc/shenandoah/shenandoahHeap.hpp"
3030
#include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
3131

32-
void ShenandoahController::pacing_notify_alloc(size_t words) {
33-
assert(ShenandoahPacing, "should only call when pacing is enabled");
34-
Atomic::add(&_allocs_seen, words, memory_order_relaxed);
35-
}
36-
37-
size_t ShenandoahController::reset_allocs_seen() {
38-
return Atomic::xchg(&_allocs_seen, (size_t)0, memory_order_relaxed);
39-
}
4032

4133
void ShenandoahController::update_gc_id() {
4234
Atomic::inc(&_gc_id);

src/hotspot/share/gc/shenandoah/shenandoahController.hpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@
3737
class ShenandoahController: public ConcurrentGCThread {
3838
private:
3939
shenandoah_padding(0);
40-
volatile size_t _allocs_seen;
41-
shenandoah_padding(1);
4240
// A monotonically increasing GC count.
4341
volatile size_t _gc_id;
44-
shenandoah_padding(2);
42+
shenandoah_padding(1);
4543

4644
protected:
4745
// While we could have a single lock for these, it may risk unblocking
@@ -55,7 +53,6 @@ class ShenandoahController: public ConcurrentGCThread {
5553

5654
public:
5755
ShenandoahController():
58-
_allocs_seen(0),
5956
_gc_id(0),
6057
_alloc_failure_waiters_lock(Mutex::safepoint-2, "ShenandoahAllocFailureGC_lock", true),
6158
_gc_waiters_lock(Mutex::safepoint-2, "ShenandoahRequestedGC_lock", true)
@@ -76,14 +73,6 @@ class ShenandoahController: public ConcurrentGCThread {
7673
// Notify threads waiting for GC to complete.
7774
void notify_alloc_failure_waiters();
7875

79-
// This is called for every allocation. The control thread accumulates
80-
// this value when idle. During the gc cycle, the control resets it
81-
// and reports it to the pacer.
82-
void pacing_notify_alloc(size_t words);
83-
84-
// Zeros out the number of allocations seen since the last GC cycle.
85-
size_t reset_allocs_seen();
86-
8776
// Return the value of a monotonic increasing GC count, maintained by the control thread.
8877
size_t get_gc_id();
8978
};

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,10 +1263,6 @@ HeapWord* ShenandoahFreeSet::allocate_contiguous(ShenandoahAllocRequest& req) {
12631263
r->set_top(r->bottom() + used_words);
12641264
}
12651265
generation->increase_affiliated_region_count(num);
1266-
if (remainder != 0) {
1267-
// Record this remainder as allocation waste
1268-
_heap->notify_mutator_alloc_words(ShenandoahHeapRegion::region_size_words() - remainder, true);
1269-
}
12701266

12711267
// retire_range_from_partition() will adjust bounds on Mutator free set if appropriate
12721268
_partitions.retire_range_from_partition(ShenandoahFreeSetPartitionId::Mutator, beg, end);

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
3838
#include "gc/shenandoah/shenandoahOldGC.hpp"
3939
#include "gc/shenandoah/shenandoahOldGeneration.hpp"
40-
#include "gc/shenandoah/shenandoahPacer.inline.hpp"
4140
#include "gc/shenandoah/shenandoahUtils.hpp"
4241
#include "gc/shenandoah/shenandoahYoungGeneration.hpp"
4342
#include "logging/log.hpp"
@@ -61,13 +60,9 @@ ShenandoahGenerationalControlThread::ShenandoahGenerationalControlThread() :
6160

6261
void ShenandoahGenerationalControlThread::run_service() {
6362

64-
const int64_t wait_ms = ShenandoahPacing ? ShenandoahControlIntervalMin : 0;
6563
ShenandoahGCRequest request;
6664
while (!should_terminate()) {
6765

68-
// This control loop iteration has seen this much allocation.
69-
const size_t allocs_seen = reset_allocs_seen();
70-
7166
// Figure out if we have pending requests.
7267
check_for_request(request);
7368

@@ -77,11 +72,6 @@ void ShenandoahGenerationalControlThread::run_service() {
7772

7873
if (request.cause != GCCause::_no_gc) {
7974
run_gc_cycle(request);
80-
} else {
81-
// Report to pacer that we have seen this many words allocated
82-
if (ShenandoahPacing && (allocs_seen > 0)) {
83-
_heap->pacer()->report_alloc(allocs_seen);
84-
}
8575
}
8676

8777
// If the cycle was cancelled, continue the next iteration to deal with it. Otherwise,
@@ -90,7 +80,7 @@ void ShenandoahGenerationalControlThread::run_service() {
9080
MonitorLocker ml(&_control_lock, Mutex::_no_safepoint_check_flag);
9181
if (_requested_gc_cause == GCCause::_no_gc) {
9282
set_gc_mode(ml, none);
93-
ml.wait(wait_ms);
83+
ml.wait();
9484
}
9585
}
9686
}
@@ -309,11 +299,6 @@ void ShenandoahGenerationalControlThread::run_gc_cycle(const ShenandoahGCRequest
309299
// Print Metaspace change following GC (if logging is enabled).
310300
MetaspaceUtils::print_metaspace_change(meta_sizes);
311301

312-
// GC is over, we are at idle now
313-
if (ShenandoahPacing) {
314-
_heap->pacer()->setup_for_idle();
315-
}
316-
317302
// Check if we have seen a new target for soft max heap size or if a gc was requested.
318303
// Either of these conditions will attempt to uncommit regions.
319304
if (ShenandoahUncommit) {
@@ -331,9 +316,6 @@ void ShenandoahGenerationalControlThread::run_gc_cycle(const ShenandoahGCRequest
331316
void ShenandoahGenerationalControlThread::process_phase_timings() const {
332317
// Commit worker statistics to cycle data
333318
_heap->phase_timings()->flush_par_workers_to_cycle();
334-
if (ShenandoahPacing) {
335-
_heap->pacer()->flush_stats_to_cycle();
336-
}
337319

338320
ShenandoahEvacuationTracker* evac_tracker = _heap->evac_tracker();
339321
ShenandoahCycleStats evac_stats = evac_tracker->flush_cycle_to_global();
@@ -347,9 +329,6 @@ void ShenandoahGenerationalControlThread::process_phase_timings() const {
347329
_heap->phase_timings()->print_cycle_on(&ls);
348330
evac_tracker->print_evacuations_on(&ls, &evac_stats.workers,
349331
&evac_stats.mutators);
350-
if (ShenandoahPacing) {
351-
_heap->pacer()->print_cycle_on(&ls);
352-
}
353332
}
354333
}
355334

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "gc/shenandoah/shenandoahGenerationalHeap.hpp"
3030
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
3131
#include "gc/shenandoah/shenandoahOldGeneration.hpp"
32-
#include "gc/shenandoah/shenandoahPacer.hpp"
3332
#include "gc/shenandoah/shenandoahScanRemembered.inline.hpp"
3433
#include "gc/shenandoah/shenandoahUtils.hpp"
3534
#include "gc/shenandoah/shenandoahYoungGeneration.hpp"
@@ -127,9 +126,6 @@ void ShenandoahGenerationalEvacuationTask::evacuate_and_promote_regions() {
127126
if (r->is_cset()) {
128127
assert(r->has_live(), "Region %zu should have been reclaimed early", r->index());
129128
_heap->marked_object_iterate(r, &cl);
130-
if (ShenandoahPacing) {
131-
_heap->pacer()->report_evac(r->used() >> LogHeapWordSize);
132-
}
133129
} else {
134130
maybe_promote_region(r);
135131
}

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -827,19 +827,15 @@ class ShenandoahGenerationalUpdateHeapRefsTask : public WorkerTask {
827827
assert(update_watermark >= r->bottom(), "sanity");
828828

829829
log_debug(gc)("Update refs worker " UINT32_FORMAT ", looking at region %zu", worker_id, r->index());
830-
bool region_progress = false;
831830
if (r->is_active() && !r->is_cset()) {
832831
if (r->is_young()) {
833832
_heap->marked_object_oop_iterate(r, &cl, update_watermark);
834-
region_progress = true;
835833
} else if (r->is_old()) {
836834
if (gc_generation->is_global()) {
837835

838836
_heap->marked_object_oop_iterate(r, &cl, update_watermark);
839-
region_progress = true;
840837
}
841838
// Otherwise, this is an old region in a young or mixed cycle. Process it during a second phase, below.
842-
// Don't bother to report pacing progress in this case.
843839
} else {
844840
// Because updating of references runs concurrently, it is possible that a FREE inactive region transitions
845841
// to a non-free active region while this loop is executing. Whenever this happens, the changing of a region's
@@ -857,10 +853,6 @@ class ShenandoahGenerationalUpdateHeapRefsTask : public WorkerTask {
857853
}
858854
}
859855

860-
if (region_progress && ShenandoahPacing) {
861-
_heap->pacer()->report_update_refs(pointer_delta(update_watermark, r->bottom()));
862-
}
863-
864856
if (_heap->check_cancelled_gc_and_yield(CONCURRENT)) {
865857
return;
866858
}
@@ -916,10 +908,6 @@ class ShenandoahGenerationalUpdateHeapRefsTask : public WorkerTask {
916908
assert(clusters * cluster_size == assignment._chunk_size, "Chunk assignment must align on cluster boundaries");
917909
scanner->process_region_slice(r, assignment._chunk_offset, clusters, end_of_range, &cl, true, worker_id);
918910
}
919-
920-
if (ShenandoahPacing) {
921-
_heap->pacer()->report_update_refs(pointer_delta(end_of_range, start_of_range));
922-
}
923911
}
924912
}
925913
}

0 commit comments

Comments
 (0)