8380846: GenShen: Remove the experimental option to disable adaptive tenuring

Reviewed-by: kdnilsen
This commit is contained in:
William Kemper 2026-03-24 23:52:27 +00:00
parent 4b38e7bcd3
commit 4e79015768
5 changed files with 12 additions and 37 deletions

View File

@ -57,21 +57,13 @@ ShenandoahAgeCensus::ShenandoahAgeCensus(uint max_workers)
// Sentinel value
_tenuring_threshold[i] = MAX_COHORTS;
}
if (ShenandoahGenerationalAdaptiveTenuring) {
_local_age_tables = NEW_C_HEAP_ARRAY(AgeTable*, _max_workers, mtGC);
CENSUS_NOISE(_local_noise = NEW_C_HEAP_ARRAY(ShenandoahNoiseStats, max_workers, mtGC);)
for (uint i = 0; i < _max_workers; i++) {
_local_age_tables[i] = new AgeTable(false);
CENSUS_NOISE(_local_noise[i].clear();)
}
} else {
_local_age_tables = nullptr;
_local_age_tables = NEW_C_HEAP_ARRAY(AgeTable*, _max_workers, mtGC);
CENSUS_NOISE(_local_noise = NEW_C_HEAP_ARRAY(ShenandoahNoiseStats, max_workers, mtGC);)
for (uint i = 0; i < _max_workers; i++) {
_local_age_tables[i] = new AgeTable(false);
CENSUS_NOISE(_local_noise[i].clear();)
}
_epoch = MAX_SNAPSHOTS - 1; // see prepare_for_census_update()
if (!ShenandoahGenerationalAdaptiveTenuring) {
_tenuring_threshold[_epoch] = InitialTenuringThreshold;
}
}
ShenandoahAgeCensus::~ShenandoahAgeCensus() {
@ -154,7 +146,6 @@ void ShenandoahAgeCensus::prepare_for_census_update() {
// and compute the new tenuring threshold.
void ShenandoahAgeCensus::update_census(size_t age0_pop) {
prepare_for_census_update();
assert(ShenandoahGenerationalAdaptiveTenuring, "Only update census when adaptive tenuring is enabled");
assert(_global_age_tables[_epoch]->is_clear(), "Dirty decks");
CENSUS_NOISE(assert(_global_noise[_epoch].is_clear(), "Dirty decks");)
@ -195,10 +186,6 @@ void ShenandoahAgeCensus::reset_global() {
// Reset the local age tables, clearing any partial census.
void ShenandoahAgeCensus::reset_local() {
if (!ShenandoahGenerationalAdaptiveTenuring) {
assert(_local_age_tables == nullptr, "Error");
return;
}
for (uint i = 0; i < _max_workers; i++) {
_local_age_tables[i]->clear();
CENSUS_NOISE(_local_noise[i].clear();)
@ -221,10 +208,6 @@ bool ShenandoahAgeCensus::is_clear_global() {
// Is local census information clear?
bool ShenandoahAgeCensus::is_clear_local() {
if (!ShenandoahGenerationalAdaptiveTenuring) {
assert(_local_age_tables == nullptr, "Error");
return true;
}
for (uint i = 0; i < _max_workers; i++) {
bool clear = _local_age_tables[i]->is_clear();
CENSUS_NOISE(clear |= _local_noise[i].is_clear();)
@ -258,7 +241,6 @@ void ShenandoahAgeCensus::update_total() {
#endif // !PRODUCT
void ShenandoahAgeCensus::update_tenuring_threshold() {
assert(ShenandoahGenerationalAdaptiveTenuring, "Only update when adaptive tenuring is enabled");
uint tt = compute_tenuring_threshold();
assert(tt <= MAX_COHORTS, "Out of bounds");
_tenuring_threshold[_epoch] = tt;

View File

@ -173,7 +173,6 @@ class ShenandoahAgeCensus: public CHeapObj<mtGC> {
~ShenandoahAgeCensus();
// Return the local age table (population vector) for worker_id.
// Only used in the case of ShenandoahGenerationalAdaptiveTenuring
AgeTable* get_local_age_table(uint worker_id) const {
return _local_age_tables[worker_id];
}

View File

@ -272,7 +272,7 @@ void ShenandoahGeneration::prepare_regions_and_collection_set(bool concurrent) {
}
// Tally the census counts and compute the adaptive tenuring threshold
if (is_generational && ShenandoahGenerationalAdaptiveTenuring) {
if (is_generational) {
// Objects above TAMS weren't included in the age census. Since they were all
// allocated in this cycle they belong in the age 0 cohort. We walk over all
// young regions and sum the volume of objects between TAMS and top.

View File

@ -117,13 +117,11 @@ inline void ShenandoahMark::count_liveness(ShenandoahLiveData* live_data, oop ob
// Age census for objects in the young generation
if (GENERATION == YOUNG || (GENERATION == GLOBAL && region->is_young())) {
assert(heap->mode()->is_generational(), "Only if generational");
if (ShenandoahGenerationalAdaptiveTenuring) {
assert(region->is_young(), "Only for young objects");
uint age = ShenandoahHeap::get_object_age(obj);
ShenandoahAgeCensus* const census = ShenandoahGenerationalHeap::heap()->age_census();
CENSUS_NOISE(census->add(age, region->age(), region->youth(), size, worker_id);)
NO_CENSUS_NOISE(census->add(age, region->age(), size, worker_id);)
}
assert(region->is_young(), "Only for young objects");
const uint age = ShenandoahHeap::get_object_age(obj);
ShenandoahAgeCensus* const census = ShenandoahGenerationalHeap::heap()->age_census();
CENSUS_NOISE(census->add(age, region->age(), region->youth(), size, worker_id);)
NO_CENSUS_NOISE(census->add(age, region->age(), size, worker_id);)
}
if (!region->is_humongous_start()) {

View File

@ -152,9 +152,6 @@
"evvort even if the usage of old generation is below " \
"ShenandoahIgnoreOldGrowthBelowPercentage.") \
\
product(bool, ShenandoahGenerationalAdaptiveTenuring, true, EXPERIMENTAL, \
"(Generational mode only) Dynamically adapt tenuring age.") \
\
product(bool, ShenandoahGenerationalCensusIgnoreOlderCohorts, true, \
EXPERIMENTAL,\
"(Generational mode only) Ignore mortality rates older than the " \
@ -179,8 +176,7 @@
"(Generational mode only) Cohort mortality rates below this " \
"value will be treated as indicative of longevity, leading to " \
"tenuring. A lower value delays tenuring, a higher value hastens "\
"it. Used only when ShenandoahGenerationalhenAdaptiveTenuring is "\
"enabled.") \
"it.") \
range(0.001,0.999) \
\
product(size_t, ShenandoahGenerationalTenuringCohortPopulationThreshold, \