Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 6ad1db4

Browse files
committedFeb 28, 2020
8240216: Shenandoah: remove ShenandoahTerminationTrace
Reviewed-by: zgu
1 parent 5afeeed commit 6ad1db4

7 files changed

+0
-139
lines changed
 

‎src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ void ShenandoahConcurrentMark::mark_from_roots() {
404404
task_queues()->reserve(nworkers);
405405

406406
{
407-
ShenandoahTerminationTracker term(ShenandoahPhaseTimings::conc_termination);
408407
TaskTerminator terminator(nworkers, task_queues());
409408
ShenandoahConcurrentMarkingTask task(this, &terminator);
410409
workers->run_task(&task);
@@ -435,10 +434,6 @@ void ShenandoahConcurrentMark::finish_mark_from_roots(bool full_gc) {
435434
ShenandoahIsAliveSelector is_alive;
436435
ReferenceProcessorIsAliveMutator fix_isalive(_heap->ref_processor(), is_alive.is_alive_closure());
437436

438-
ShenandoahTerminationTracker termination_tracker(full_gc ?
439-
ShenandoahPhaseTimings::full_gc_mark_termination :
440-
ShenandoahPhaseTimings::termination);
441-
442437
StrongRootsScope scope(nworkers);
443438
TaskTerminator terminator(nworkers, task_queues());
444439
ShenandoahFinalMarkingTask task(this, &terminator, ShenandoahStringDedup::is_enabled());
@@ -636,11 +631,6 @@ void ShenandoahConcurrentMark::weak_refs_work_doit(bool full_gc) {
636631
ShenandoahPhaseTimings::full_gc_weakrefs_process :
637632
ShenandoahPhaseTimings::weakrefs_process;
638633

639-
ShenandoahPhaseTimings::Phase phase_process_termination =
640-
full_gc ?
641-
ShenandoahPhaseTimings::full_gc_weakrefs_termination :
642-
ShenandoahPhaseTimings::weakrefs_termination;
643-
644634
shenandoah_assert_rp_isalive_not_installed();
645635
ShenandoahIsAliveSelector is_alive;
646636
ReferenceProcessorIsAliveMutator fix_isalive(rp, is_alive.is_alive_closure());
@@ -667,7 +657,6 @@ void ShenandoahConcurrentMark::weak_refs_work_doit(bool full_gc) {
667657

668658
{
669659
ShenandoahGCPhase phase(phase_process);
670-
ShenandoahTerminationTracker phase_term(phase_process_termination);
671660

672661
if (_heap->has_forwarded_objects()) {
673662
ShenandoahCMKeepAliveUpdateClosure keep_alive(get_queue(serial_worker_id));
@@ -942,7 +931,6 @@ void ShenandoahConcurrentMark::mark_loop_work(T* cl, jushort* live_data, uint wo
942931
// No work encountered in current stride, try to terminate.
943932
// Need to leave the STS here otherwise it might block safepoints.
944933
ShenandoahSuspendibleThreadSetLeaver stsl(CANCELLABLE && ShenandoahSuspendibleWorkers);
945-
ShenandoahTerminationTimingsTracker term_tracker(worker_id);
946934
ShenandoahTerminatorTerminator tt(heap);
947935
if (terminator->offer_termination(&tt)) return;
948936
}

‎src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp

-28
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const char* ShenandoahPhaseTimings::_phase_names[] = {
4444
ShenandoahPhaseTimings::ShenandoahPhaseTimings() : _policy(NULL) {
4545
uint max_workers = MAX2(ConcGCThreads, ParallelGCThreads);
4646
_worker_times = new ShenandoahWorkerTimings(max_workers);
47-
_termination_times = new ShenandoahTerminationTimings(max_workers);
4847
_policy = ShenandoahHeap::heap()->shenandoah_policy();
4948
assert(_policy != NULL, "Can not be NULL");
5049
}
@@ -165,30 +164,3 @@ void ShenandoahWorkerTimings::print() const {
165164
_gc_par_phases[i]->print_summary_on(tty);
166165
}
167166
}
168-
169-
170-
ShenandoahTerminationTimings::ShenandoahTerminationTimings(uint max_gc_threads) {
171-
_gc_termination_phase = new WorkerDataArray<double>("Task Termination (ms):", max_gc_threads);
172-
}
173-
174-
void ShenandoahTerminationTimings::record_time_secs(uint worker_id, double secs) {
175-
if (_gc_termination_phase->get(worker_id) == WorkerDataArray<double>::uninitialized()) {
176-
_gc_termination_phase->set(worker_id, secs);
177-
} else {
178-
// worker may re-enter termination phase
179-
_gc_termination_phase->add(worker_id, secs);
180-
}
181-
}
182-
183-
void ShenandoahTerminationTimings::print() const {
184-
_gc_termination_phase->print_summary_on(tty);
185-
}
186-
187-
double ShenandoahTerminationTimings::average() const {
188-
return _gc_termination_phase->average();
189-
}
190-
191-
void ShenandoahTerminationTimings::reset() {
192-
_gc_termination_phase->reset();
193-
}
194-

‎src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp

-25
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
class ShenandoahCollectorPolicy;
3333
class ShenandoahWorkerTimings;
34-
class ShenandoahTerminationTimings;
3534
class outputStream;
3635

3736
#define SHENANDOAH_GC_PHASE_DO(f) \
@@ -92,10 +91,8 @@ class outputStream;
9291
f(update_finish_queues, " U: Finish Queues") \
9392
\
9493
f(finish_queues, " Finish Queues") \
95-
f(termination, " Termination") \
9694
f(weakrefs, " Weak References") \
9795
f(weakrefs_process, " Process") \
98-
f(weakrefs_termination, " Termination") \
9996
f(purge, " System Purge") \
10097
f(purge_class_unload, " Unload Classes") \
10198
f(purge_par, " Parallel Cleanup") \
@@ -244,7 +241,6 @@ class outputStream;
244241
f(final_traversal_gc_string_dedup_table_roots, " TF: Dedup Table Roots") \
245242
f(final_traversal_gc_string_dedup_queue_roots, " TF: Dedup Queue Roots") \
246243
f(final_traversal_gc_finish_queues, " TF: Finish Queues") \
247-
f(final_traversal_gc_termination, " TF: Termination") \
248244
\
249245
/* Per-thread timer block, should have "roots" counters in consistent order */ \
250246
f(final_traversal_update_roots, " Update Roots") \
@@ -300,10 +296,8 @@ class outputStream;
300296
\
301297
f(full_gc_mark, " Mark") \
302298
f(full_gc_mark_finish_queues, " Finish Queues") \
303-
f(full_gc_mark_termination, " Termination") \
304299
f(full_gc_weakrefs, " Weak References") \
305300
f(full_gc_weakrefs_process, " Process") \
306-
f(full_gc_weakrefs_termination, " Termination") \
307301
f(full_gc_purge, " System Purge") \
308302
f(full_gc_purge_class_unload, " Unload Classes") \
309303
f(full_gc_purge_par, " Parallel Cleanup") \
@@ -322,14 +316,12 @@ class outputStream;
322316
/* Longer concurrent phases at the end */ \
323317
f(conc_reset, "Concurrent Reset") \
324318
f(conc_mark, "Concurrent Marking") \
325-
f(conc_termination, " Termination") \
326319
f(conc_preclean, "Concurrent Precleaning") \
327320
f(conc_roots, "Concurrent Roots") \
328321
f(conc_evac, "Concurrent Evacuation") \
329322
f(conc_update_refs, "Concurrent Update Refs") \
330323
f(conc_cleanup, "Concurrent Cleanup") \
331324
f(conc_traversal, "Concurrent Traversal") \
332-
f(conc_traversal_termination, " Termination") \
333325
\
334326
f(conc_uncommit, "Concurrent Uncommit") \
335327
\
@@ -390,15 +382,13 @@ class ShenandoahPhaseTimings : public CHeapObj<mtGC> {
390382
static const char* _phase_names[_num_phases];
391383

392384
ShenandoahWorkerTimings* _worker_times;
393-
ShenandoahTerminationTimings* _termination_times;
394385

395386
ShenandoahCollectorPolicy* _policy;
396387

397388
public:
398389
ShenandoahPhaseTimings();
399390

400391
ShenandoahWorkerTimings* const worker_times() const { return _worker_times; }
401-
ShenandoahTerminationTimings* const termination_times() const { return _termination_times; }
402392

403393
// record phase start
404394
void record_phase_start(Phase phase);
@@ -438,19 +428,4 @@ class ShenandoahWorkerTimings : public CHeapObj<mtGC> {
438428
void print() const;
439429
};
440430

441-
class ShenandoahTerminationTimings : public CHeapObj<mtGC> {
442-
private:
443-
WorkerDataArray<double>* _gc_termination_phase;
444-
public:
445-
ShenandoahTerminationTimings(uint max_gc_threads);
446-
447-
// record the time a phase took in seconds
448-
void record_time_secs(uint worker_i, double secs);
449-
450-
double average() const;
451-
void reset();
452-
453-
void print() const;
454-
};
455-
456431
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHPHASETIMINGS_HPP

‎src/hotspot/share/gc/shenandoah/shenandoahTimingTracker.cpp

-43
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#include "runtime/os.hpp"
3232

3333

34-
ShenandoahPhaseTimings::Phase ShenandoahTerminationTracker::_current_termination_phase = ShenandoahPhaseTimings::_num_phases;
35-
3634
ShenandoahWorkerTimingsTracker::ShenandoahWorkerTimingsTracker(ShenandoahWorkerTimings* worker_times,
3735
ShenandoahPhaseTimings::GCParPhases phase, uint worker_id) :
3836
_phase(phase), _worker_times(worker_times), _worker_id(worker_id) {
@@ -53,44 +51,3 @@ ShenandoahWorkerTimingsTracker::~ShenandoahWorkerTimingsTracker() {
5351
}
5452
}
5553

56-
ShenandoahTerminationTimingsTracker::ShenandoahTerminationTimingsTracker(uint worker_id) :
57-
_worker_id(worker_id) {
58-
if (ShenandoahTerminationTrace) {
59-
_start_time = os::elapsedTime();
60-
}
61-
}
62-
63-
ShenandoahTerminationTimingsTracker::~ShenandoahTerminationTimingsTracker() {
64-
if (ShenandoahTerminationTrace) {
65-
ShenandoahHeap::heap()->phase_timings()->termination_times()->record_time_secs(_worker_id, os::elapsedTime() - _start_time);
66-
}
67-
}
68-
69-
ShenandoahTerminationTracker::ShenandoahTerminationTracker(ShenandoahPhaseTimings::Phase phase) : _phase(phase) {
70-
assert(_current_termination_phase == ShenandoahPhaseTimings::_num_phases, "Should be invalid");
71-
assert(phase == ShenandoahPhaseTimings::termination ||
72-
phase == ShenandoahPhaseTimings::final_traversal_gc_termination ||
73-
phase == ShenandoahPhaseTimings::full_gc_mark_termination ||
74-
phase == ShenandoahPhaseTimings::conc_termination ||
75-
phase == ShenandoahPhaseTimings::conc_traversal_termination ||
76-
phase == ShenandoahPhaseTimings::weakrefs_termination ||
77-
phase == ShenandoahPhaseTimings::full_gc_weakrefs_termination,
78-
"Only these phases");
79-
80-
assert(!Thread::current()->is_Worker_thread() &&
81-
(Thread::current()->is_VM_thread() ||
82-
Thread::current()->is_ConcurrentGC_thread()),
83-
"Called from wrong thread");
84-
85-
_current_termination_phase = phase;
86-
ShenandoahHeap::heap()->phase_timings()->termination_times()->reset();
87-
}
88-
89-
ShenandoahTerminationTracker::~ShenandoahTerminationTracker() {
90-
assert(_phase == _current_termination_phase, "Can not change phase");
91-
ShenandoahPhaseTimings* phase_times = ShenandoahHeap::heap()->phase_timings();
92-
93-
double t = phase_times->termination_times()->average();
94-
phase_times->record_phase_time(_phase, t);
95-
debug_only(_current_termination_phase = ShenandoahPhaseTimings::_num_phases;)
96-
}

‎src/hotspot/share/gc/shenandoah/shenandoahTimingTracker.hpp

-24
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,4 @@ class ShenandoahWorkerTimingsTracker : public StackObj {
4242
~ShenandoahWorkerTimingsTracker();
4343
};
4444

45-
46-
class ShenandoahTerminationTimingsTracker : public StackObj {
47-
private:
48-
double _start_time;
49-
uint _worker_id;
50-
51-
public:
52-
ShenandoahTerminationTimingsTracker(uint worker_id);
53-
~ShenandoahTerminationTimingsTracker();
54-
};
55-
56-
// Tracking termination time in specific GC phase
57-
class ShenandoahTerminationTracker : public StackObj {
58-
private:
59-
ShenandoahPhaseTimings::Phase _phase;
60-
61-
static ShenandoahPhaseTimings::Phase _current_termination_phase;
62-
public:
63-
ShenandoahTerminationTracker(ShenandoahPhaseTimings::Phase phase);
64-
~ShenandoahTerminationTracker();
65-
66-
static ShenandoahPhaseTimings::Phase current_termination_phase() { return _current_termination_phase; }
67-
};
68-
6945
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHTIMINGTRACKER_HPP

‎src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,6 @@ void ShenandoahTraversalGC::main_loop_work(T* cl, jushort* live_data, uint worke
538538
if (work == 0) {
539539
// No more work, try to terminate
540540
ShenandoahSuspendibleThreadSetLeaver stsl(sts_yield && ShenandoahSuspendibleWorkers);
541-
ShenandoahTerminationTimingsTracker term_tracker(worker_id);
542541
ShenandoahTerminatorTerminator tt(_heap);
543542

544543
if (terminator->offer_termination(&tt)) return;
@@ -558,7 +557,6 @@ void ShenandoahTraversalGC::concurrent_traversal_collection() {
558557
if (!_heap->cancelled_gc()) {
559558
uint nworkers = _heap->workers()->active_workers();
560559
task_queues()->reserve(nworkers);
561-
ShenandoahTerminationTracker tracker(ShenandoahPhaseTimings::conc_traversal_termination);
562560

563561
TaskTerminator terminator(nworkers, task_queues());
564562
ShenandoahConcurrentTraversalCollectionTask task(&terminator);
@@ -581,8 +579,6 @@ void ShenandoahTraversalGC::final_traversal_collection() {
581579

582580
// Finish traversal
583581
ShenandoahAllRootScanner rp(nworkers, ShenandoahPhaseTimings::final_traversal_gc_work);
584-
ShenandoahTerminationTracker term(ShenandoahPhaseTimings::final_traversal_gc_termination);
585-
586582
TaskTerminator terminator(nworkers, task_queues());
587583
ShenandoahFinalTraversalCollectionTask task(&rp, &terminator);
588584
_heap->workers()->run_task(&task);

‎src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,6 @@
298298
diagnostic(bool, ShenandoahAllocFailureALot, false, \
299299
"Make lots of artificial allocation failures.") \
300300
\
301-
diagnostic(bool, ShenandoahTerminationTrace, false, \
302-
"Tracing task termination timings") \
303-
\
304301
diagnostic(bool, ShenandoahAlwaysPreTouch, false, \
305302
"Pre-touch heap memory, overrides global AlwaysPreTouch") \
306303
\

0 commit comments

Comments
 (0)
This repository has been archived.