8223162: Improve ergonomics for Sparse PRT entry sizing
Scale Sparse PRT table sizes exponentially according to region size. Reviewed-by: kbarrett, sangheki
This commit is contained in:
parent
cb6e66a5ee
commit
ac21f1bdd5
src/hotspot/share/gc/g1
@ -614,12 +614,12 @@ void HeapRegionRemSet::clear_fcc() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HeapRegionRemSet::setup_remset_size() {
|
void HeapRegionRemSet::setup_remset_size() {
|
||||||
// Setup sparse and fine-grain tables sizes.
|
|
||||||
// table_size = base * (log(region_size / 1M) + 1)
|
|
||||||
const int LOG_M = 20;
|
const int LOG_M = 20;
|
||||||
int region_size_log_mb = MAX2(HeapRegion::LogOfHRGrainBytes - LOG_M, 0);
|
guarantee(HeapRegion::LogOfHRGrainBytes >= LOG_M, "Code assumes the region size >= 1M, but is " SIZE_FORMAT "B", HeapRegion::GrainBytes);
|
||||||
|
|
||||||
|
int region_size_log_mb = HeapRegion::LogOfHRGrainBytes - LOG_M;
|
||||||
if (FLAG_IS_DEFAULT(G1RSetSparseRegionEntries)) {
|
if (FLAG_IS_DEFAULT(G1RSetSparseRegionEntries)) {
|
||||||
G1RSetSparseRegionEntries = G1RSetSparseRegionEntriesBase * (region_size_log_mb + 1);
|
G1RSetSparseRegionEntries = G1RSetSparseRegionEntriesBase * ((size_t)1 << (region_size_log_mb + 1));
|
||||||
}
|
}
|
||||||
if (FLAG_IS_DEFAULT(G1RSetRegionEntries)) {
|
if (FLAG_IS_DEFAULT(G1RSetRegionEntries)) {
|
||||||
G1RSetRegionEntries = G1RSetRegionEntriesBase * (region_size_log_mb + 1);
|
G1RSetRegionEntries = G1RSetRegionEntriesBase * (region_size_log_mb + 1);
|
||||||
|
@ -179,6 +179,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
HeapRegionRemSet(G1BlockOffsetTable* bot, HeapRegion* hr);
|
HeapRegionRemSet(G1BlockOffsetTable* bot, HeapRegion* hr);
|
||||||
|
|
||||||
|
// Setup sparse and fine-grain tables sizes.
|
||||||
static void setup_remset_size();
|
static void setup_remset_size();
|
||||||
|
|
||||||
bool cardset_is_empty() const {
|
bool cardset_is_empty() const {
|
||||||
|
@ -218,9 +218,7 @@ class SparsePRT {
|
|||||||
|
|
||||||
RSHashTable* _table;
|
RSHashTable* _table;
|
||||||
|
|
||||||
enum SomeAdditionalPrivateConstants {
|
static const size_t InitialCapacity = 8;
|
||||||
InitialCapacity = 16
|
|
||||||
};
|
|
||||||
|
|
||||||
void expand();
|
void expand();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user