Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
neethu-prasad committed Aug 1, 2024
1 parent 045eb14 commit 3cb8e1c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
5 changes: 1 addition & 4 deletions src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ void ShenandoahConcurrentMark::concurrent_mark() {

ShenandoahSATBMarkQueueSet& qset = ShenandoahBarrierSet::satb_mark_queue_set();
ShenandoahFlushSATBHandshakeClosure flush_satb(qset);
double handshake_total_time = 0;
uint flushes;
for (flushes = 0; flushes < ShenandoahMaxSATBBufferFlushes; flushes++) {
for (uint flushes = 0; flushes < ShenandoahMaxSATBBufferFlushes; flushes++) {
TaskTerminator terminator(nworkers, task_queues());
ShenandoahConcurrentMarkingTask<NON_GEN> task(this, &terminator);
workers->run_task(&task);
Expand All @@ -229,7 +227,6 @@ void ShenandoahConcurrentMark::concurrent_mark() {
break;
}
}

assert(task_queues()->is_empty() || heap->cancelled_gc(), "Should be empty when not cancelled");
}

Expand Down
12 changes: 6 additions & 6 deletions src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ class ShenandoahPhaseTimings : public CHeapObj<mtGC> {
ShenandoahWorkerData* worker_data(Phase phase, ParPhase par_phase);
Phase worker_par_phase(Phase phase, ParPhase par_phase);

void set_cycle_data(Phase phase, double time, bool should_aggregate=false);
void set_cycle_data(Phase phase, double time, bool should_aggregate_cycles=false);
static double uninitialized() { return -1; }

public:
ShenandoahPhaseTimings(uint max_workers);

void record_phase_time(Phase phase, double time, bool should_aggregate=false);
void record_phase_time(Phase phase, double time, bool should_aggregate_cycles=false);

void record_workers_start(Phase phase);
void record_workers_end(Phase phase);
Expand All @@ -237,11 +237,11 @@ class ShenandoahPhaseTimings : public CHeapObj<mtGC> {
}

static const char* phase_name_without_leading_whitespace(Phase phase) {
const char* current_phase_name = phase_name(phase);
while (*current_phase_name == ' ') {
current_phase_name++;
const char* trimmed_phase_name = phase_name(phase);
while (*trimmed_phase_name == ' ') {
trimmed_phase_name++;
}
return current_phase_name;
return trimmed_phase_name;
}

void print_cycle_on(outputStream* out) const;
Expand Down
7 changes: 1 addition & 6 deletions src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ ShenandoahConcurrentPhase::~ShenandoahConcurrentPhase() {
_timer->register_gc_concurrent_end();
}

ShenandoahTimingsTracker::ShenandoahTimingsTracker(ShenandoahPhaseTimings::Phase phase) :
ShenandoahTimingsTracker(phase, false) {

}

ShenandoahTimingsTracker::ShenandoahTimingsTracker(ShenandoahPhaseTimings::Phase phase, bool should_aggregate_cycles) :
_timings(ShenandoahHeap::heap()->phase_timings()), _phase(phase) {
assert(Thread::current()->is_VM_thread() || Thread::current()->is_ConcurrentGC_thread(),
Expand All @@ -131,8 +126,8 @@ ShenandoahTimingsTracker::~ShenandoahTimingsTracker() {
double end_time = os::elapsedTime();
double phase_elapsed_time = end_time - _start;
_timings->record_phase_time(_phase, phase_elapsed_time, _should_aggregate_cycles);
log_info(gc, phases) ("Ended phase : %s. Elapsed time %f ms", ShenandoahPhaseTimings::phase_name_without_leading_whitespace(_phase), phase_elapsed_time * MILLIUNITS);
_current_phase = _parent_phase;
log_info(gc, phases) ("Ended phase : %s. Elapsed time %f ms", ShenandoahPhaseTimings::phase_name_without_leading_whitespace(_phase), phase_elapsed_time * MILLIUNITS);
}

bool ShenandoahTimingsTracker::is_current_phase_valid() {
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class ShenandoahTimingsTracker : public StackObj {
bool _should_aggregate_cycles;

public:
ShenandoahTimingsTracker(ShenandoahPhaseTimings::Phase phase);
ShenandoahTimingsTracker(ShenandoahPhaseTimings::Phase phase, bool should_aggregate_cycles);
ShenandoahTimingsTracker(ShenandoahPhaseTimings::Phase phase, bool should_aggregate_cycles=false);
~ShenandoahTimingsTracker();

static ShenandoahPhaseTimings::Phase current_phase() { return _current_phase; }
Expand Down

0 comments on commit 3cb8e1c

Please sign in to comment.