mirror of
https://github.com/darlinghq/darling-openjdk.git
synced 2024-11-27 14:20:27 +00:00
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
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -218,9 +218,7 @@ class SparsePRT {
|
||||
|
||||
RSHashTable* _table;
|
||||
|
||||
enum SomeAdditionalPrivateConstants {
|
||||
InitialCapacity = 16
|
||||
};
|
||||
static const size_t InitialCapacity = 8;
|
||||
|
||||
void expand();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user