8179677: Let G1Remset::_conc_refined_cards only count number of cards concurrently refined
Reviewed-by: sjohanss, ehelin
--- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp Tue Jul 04 09:15:45 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp Tue Jul 04 09:16:26 2017 +0200
@@ -282,7 +282,7 @@
G1HotCardCache* hot_card_cache) :
_g1(g1),
_scan_state(new G1RemSetScanState()),
- _conc_refine_cards(0),
+ _num_conc_refined_cards(0),
_ct_bs(ct_bs),
_g1p(_g1->g1_policy()),
_hot_card_cache(hot_card_cache),
@@ -724,7 +724,7 @@
sdcq->enqueue(card_ptr);
}
} else {
- _conc_refine_cards++;
+ _num_conc_refined_cards++; // Unsynchronized update, only used for logging.
}
}
@@ -768,7 +768,6 @@
bool card_processed = r->oops_on_card_seq_iterate_careful<true>(dirty_region, update_rs_cl);
assert(card_processed, "must be");
- _conc_refine_cards++;
return update_rs_cl->has_refs_into_cset();
}
--- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp Tue Jul 04 09:15:45 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp Tue Jul 04 09:16:26 2017 +0200
@@ -76,7 +76,7 @@
void update_rem_set(DirtyCardQueue* into_cset_dcq, G1ParScanThreadState* pss, uint worker_i);
G1CollectedHeap* _g1;
- size_t _conc_refine_cards;
+ size_t _num_conc_refined_cards; // Number of cards refined concurrently to the mutator.
CardTableModRefBS* _ct_bs;
G1Policy* _g1p;
@@ -145,7 +145,7 @@
// Print accumulated summary info from the last time called.
void print_periodic_summary_info(const char* header, uint period_count);
- size_t conc_refine_cards() const { return _conc_refine_cards; }
+ size_t num_conc_refined_cards() const { return _num_conc_refined_cards; }
void create_card_live_data(WorkGang* workers, G1CMBitMap* mark_bitmap);
void finalize_card_live_data(WorkGang* workers, G1CMBitMap* mark_bitmap);
--- a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp Tue Jul 04 09:15:45 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp Tue Jul 04 09:16:26 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
};
void G1RemSetSummary::update() {
- _num_refined_cards = remset()->conc_refine_cards();
+ _num_conc_refined_cards = remset()->num_conc_refined_cards();
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
_num_processed_buf_mutator = dcqs.processed_buffers_mut();
_num_processed_buf_rs_threads = dcqs.processed_buffers_rs_thread();
@@ -93,7 +93,7 @@
G1RemSetSummary::G1RemSetSummary() :
_remset(NULL),
- _num_refined_cards(0),
+ _num_conc_refined_cards(0),
_num_processed_buf_mutator(0),
_num_processed_buf_rs_threads(0),
_num_coarsenings(0),
@@ -113,7 +113,7 @@
assert(remset() == other->remset(), "just checking");
assert(_num_vtimes == other->_num_vtimes, "just checking");
- _num_refined_cards = other->num_concurrent_refined_cards();
+ _num_conc_refined_cards = other->num_conc_refined_cards();
_num_processed_buf_mutator = other->num_processed_buf_mutator();
_num_processed_buf_rs_threads = other->num_processed_buf_rs_threads();
@@ -130,7 +130,7 @@
assert(remset() == other->remset(), "just checking");
assert(_num_vtimes == other->_num_vtimes, "just checking");
- _num_refined_cards = other->num_concurrent_refined_cards() - _num_refined_cards;
+ _num_conc_refined_cards = other->num_conc_refined_cards() - _num_conc_refined_cards;
_num_processed_buf_mutator = other->num_processed_buf_mutator() - _num_processed_buf_mutator;
_num_processed_buf_rs_threads = other->num_processed_buf_rs_threads() - _num_processed_buf_rs_threads;
@@ -352,8 +352,7 @@
void G1RemSetSummary::print_on(outputStream* out) {
out->print_cr(" Recent concurrent refinement statistics");
- out->print_cr(" Processed " SIZE_FORMAT " cards",
- num_concurrent_refined_cards());
+ out->print_cr(" Processed " SIZE_FORMAT " cards concurrently", num_conc_refined_cards());
out->print_cr(" Of " SIZE_FORMAT " completed buffers:", num_processed_buf_total());
out->print_cr(" " SIZE_FORMAT_W(8) " (%5.1f%%) by concurrent RS threads.",
num_processed_buf_total(),
--- a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp Tue Jul 04 09:15:45 2017 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp Tue Jul 04 09:16:26 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
return _remset;
}
- size_t _num_refined_cards;
+ size_t _num_conc_refined_cards;
size_t _num_processed_buf_mutator;
size_t _num_processed_buf_rs_threads;
@@ -82,8 +82,8 @@
return _sampling_thread_vtime;
}
- size_t num_concurrent_refined_cards() const {
- return _num_refined_cards;
+ size_t num_conc_refined_cards() const {
+ return _num_conc_refined_cards;
}
size_t num_processed_buf_mutator() const {