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:
Thomas Schatzl 2019-06-03 10:50:14 +02:00
parent cb6e66a5ee
commit ac21f1bdd5
3 changed files with 6 additions and 7 deletions

View File

@ -614,12 +614,12 @@ void HeapRegionRemSet::clear_fcc() {
}
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;
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)) {
G1RSetSparseRegionEntries = G1RSetSparseRegionEntriesBase * (region_size_log_mb + 1);
G1RSetSparseRegionEntries = G1RSetSparseRegionEntriesBase * ((size_t)1 << (region_size_log_mb + 1));
}
if (FLAG_IS_DEFAULT(G1RSetRegionEntries)) {
G1RSetRegionEntries = G1RSetRegionEntriesBase * (region_size_log_mb + 1);

View File

@ -179,6 +179,7 @@ private:
public:
HeapRegionRemSet(G1BlockOffsetTable* bot, HeapRegion* hr);
// Setup sparse and fine-grain tables sizes.
static void setup_remset_size();
bool cardset_is_empty() const {

View File

@ -218,9 +218,7 @@ class SparsePRT {
RSHashTable* _table;
enum SomeAdditionalPrivateConstants {
InitialCapacity = 16
};
static const size_t InitialCapacity = 8;
void expand();