8297033: G1: Improve logging for Remembered Sets
Reviewed-by: tschatzl, kbarrett
This commit is contained in:
parent
c6156f9123
commit
5459b1104f
@ -318,11 +318,7 @@ void G1GCPhaseTimes::details(T* phase, uint indent_level) const {
|
||||
}
|
||||
}
|
||||
|
||||
void G1GCPhaseTimes::log_phase(WorkerDataArray<double>* phase, uint indent_level, outputStream* out, bool print_sum) const {
|
||||
out->sp(indent_level * 2);
|
||||
phase->print_summary_on(out, print_sum);
|
||||
details(phase, indent_level);
|
||||
|
||||
void G1GCPhaseTimes::print_thread_work_items(WorkerDataArray<double>* phase, uint indent_level, outputStream* out) const {
|
||||
for (uint i = 0; i < phase->MaxThreadWorkItems; i++) {
|
||||
WorkerDataArray<size_t>* work_items = phase->thread_work_items(i);
|
||||
if (work_items != NULL) {
|
||||
@ -333,6 +329,37 @@ void G1GCPhaseTimes::log_phase(WorkerDataArray<double>* phase, uint indent_level
|
||||
}
|
||||
}
|
||||
|
||||
void G1GCPhaseTimes::debug_phase_merge_remset() const {
|
||||
LogTarget(Debug, gc, phases) lt;
|
||||
if (!lt.is_enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ResourceMark rm;
|
||||
LogStream ls(lt);
|
||||
|
||||
WorkerDataArray<double>* phase = _gc_par_phases[MergeRS];
|
||||
WorkerDataArray<double>* sub_phase = _gc_par_phases[MergeER];
|
||||
|
||||
uint indent_level = 2;
|
||||
|
||||
ls.sp(indent_level * 2);
|
||||
phase->print_summary_on(&ls, true);
|
||||
details(phase, indent_level);
|
||||
|
||||
log_phase(sub_phase, (indent_level + 1), &ls, true);
|
||||
|
||||
print_thread_work_items(phase, indent_level, &ls);
|
||||
}
|
||||
|
||||
void G1GCPhaseTimes::log_phase(WorkerDataArray<double>* phase, uint indent_level, outputStream* out, bool print_sum) const {
|
||||
out->sp(indent_level * 2);
|
||||
phase->print_summary_on(out, print_sum);
|
||||
details(phase, indent_level);
|
||||
|
||||
print_thread_work_items(phase, indent_level, out);
|
||||
}
|
||||
|
||||
void G1GCPhaseTimes::debug_phase(WorkerDataArray<double>* phase, uint extra_indent) const {
|
||||
LogTarget(Debug, gc, phases) lt;
|
||||
if (lt.is_enabled()) {
|
||||
@ -435,8 +462,8 @@ double G1GCPhaseTimes::print_evacuate_initial_collection_set() const {
|
||||
info_time("Merge Heap Roots", _cur_merge_heap_roots_time_ms);
|
||||
|
||||
debug_time("Prepare Merge Heap Roots", _cur_prepare_merge_heap_roots_time_ms);
|
||||
debug_phase(_gc_par_phases[MergeER]);
|
||||
debug_phase(_gc_par_phases[MergeRS]);
|
||||
debug_phase_merge_remset();
|
||||
|
||||
if (G1HotCardCache::use_cache()) {
|
||||
debug_phase(_gc_par_phases[MergeHCC]);
|
||||
}
|
||||
|
@ -222,6 +222,9 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
|
||||
template <class T>
|
||||
void details(T* phase, uint indent_level) const;
|
||||
|
||||
void print_thread_work_items(WorkerDataArray<double>* phase, uint indent_level, outputStream* out) const;
|
||||
void debug_phase_merge_remset() const;
|
||||
|
||||
void log_work_items(WorkerDataArray<double>* phase, uint indent, outputStream* out) const;
|
||||
void log_phase(WorkerDataArray<double>* phase, uint indent_level, outputStream* out, bool print_sum) const;
|
||||
void debug_serial_phase(WorkerDataArray<double>* phase, uint extra_indent = 0) const;
|
||||
|
@ -1332,38 +1332,43 @@ public:
|
||||
G1GCPhaseTimes::MergeRS :
|
||||
G1GCPhaseTimes::OptMergeRS;
|
||||
|
||||
// We schedule flushing the remembered sets of humongous fast reclaim candidates
|
||||
// onto the card table first to allow the remaining parallelized tasks hide it.
|
||||
if (_initial_evacuation &&
|
||||
g1h->has_humongous_reclaim_candidates() &&
|
||||
!_fast_reclaim_handled &&
|
||||
!Atomic::cmpxchg(&_fast_reclaim_handled, false, true)) {
|
||||
|
||||
G1GCParPhaseTimesTracker x(p, G1GCPhaseTimes::MergeER, worker_id);
|
||||
|
||||
G1FlushHumongousCandidateRemSets cl(_scan_state);
|
||||
g1h->heap_region_iterate(&cl);
|
||||
|
||||
for (uint i = 0; i < G1GCPhaseTimes::MergeRSContainersSentinel; i++) {
|
||||
p->record_or_add_thread_work_item(merge_remset_phase, worker_id, cl.merged(i), i);
|
||||
}
|
||||
}
|
||||
|
||||
// Merge remembered sets of current candidates.
|
||||
{
|
||||
// Merge remset of ...
|
||||
G1GCParPhaseTimesTracker x(p, merge_remset_phase, worker_id, !_initial_evacuation /* allow_multiple_record */);
|
||||
G1MergeCardSetStats stats;
|
||||
{
|
||||
G1MergeCardSetClosure merge(_scan_state);
|
||||
G1ClearBitmapClosure clear(g1h);
|
||||
G1CombinedClosure combined(&merge, &clear);
|
||||
|
||||
g1h->collection_set_iterate_increment_from(&combined, nullptr, worker_id);
|
||||
stats = merge.stats();
|
||||
{
|
||||
// 1. eager-reclaim candidates
|
||||
if (_initial_evacuation &&
|
||||
g1h->has_humongous_reclaim_candidates() &&
|
||||
!_fast_reclaim_handled &&
|
||||
!Atomic::cmpxchg(&_fast_reclaim_handled, false, true)) {
|
||||
|
||||
G1GCParPhaseTimesTracker subphase_x(p, G1GCPhaseTimes::MergeER, worker_id);
|
||||
|
||||
G1FlushHumongousCandidateRemSets cl(_scan_state);
|
||||
g1h->heap_region_iterate(&cl);
|
||||
|
||||
for (uint i = 0; i < G1GCPhaseTimes::MergeRSContainersSentinel; i++) {
|
||||
p->record_or_add_thread_work_item(merge_remset_phase, worker_id, cl.merged(i), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (uint i = 0; i < G1GCPhaseTimes::MergeRSContainersSentinel; i++) {
|
||||
p->record_or_add_thread_work_item(merge_remset_phase, worker_id, stats.merged(i), i);
|
||||
{
|
||||
// 2. collection set
|
||||
G1MergeCardSetStats stats;
|
||||
{
|
||||
G1MergeCardSetClosure merge(_scan_state);
|
||||
G1ClearBitmapClosure clear(g1h);
|
||||
G1CombinedClosure combined(&merge, &clear);
|
||||
|
||||
g1h->collection_set_iterate_increment_from(&combined, nullptr, worker_id);
|
||||
stats = merge.stats();
|
||||
}
|
||||
|
||||
for (uint i = 0; i < G1GCPhaseTimes::MergeRSContainersSentinel; i++) {
|
||||
p->record_or_add_thread_work_item(merge_remset_phase, worker_id, stats.merged(i), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user