8234532: Remove ThreadLocalAllocBuffer::_fast_refill_waste since it is never set

Reviewed-by: tschatzl, sjohanss, pliden, sspitsyn
This commit is contained in:
Albert Mingkun Yang 2021-05-19 17:02:39 +00:00
parent 237fee8bbd
commit 99fcc410a7
5 changed files with 7 additions and 43 deletions

View file

@ -51,7 +51,6 @@ ThreadLocalAllocBuffer::ThreadLocalAllocBuffer() :
_allocated_before_last_gc(0),
_bytes_since_last_sample_point(0),
_number_of_refills(0),
_fast_refill_waste(0),
_slow_refill_waste(0),
_gc_waste(0),
_slow_allocations(0),
@ -105,11 +104,9 @@ void ThreadLocalAllocBuffer::accumulate_and_reset_statistics(ThreadLocalAllocSta
stats->update_fast_allocations(_number_of_refills,
_allocated_size,
_gc_waste,
_fast_refill_waste,
_slow_refill_waste);
} else {
assert(_number_of_refills == 0 && _fast_refill_waste == 0 &&
_slow_refill_waste == 0 && _gc_waste == 0,
assert(_number_of_refills == 0 && _slow_refill_waste == 0 && _gc_waste == 0,
"tlab stats == 0");
}
@ -176,7 +173,6 @@ void ThreadLocalAllocBuffer::resize() {
void ThreadLocalAllocBuffer::reset_statistics() {
_number_of_refills = 0;
_fast_refill_waste = 0;
_slow_refill_waste = 0;
_gc_waste = 0;
_slow_allocations = 0;
@ -296,14 +292,14 @@ void ThreadLocalAllocBuffer::print_stats(const char* tag) {
}
Thread* thrd = thread();
size_t waste = _gc_waste + _slow_refill_waste + _fast_refill_waste;
size_t waste = _gc_waste + _slow_refill_waste;
double waste_percent = percent_of(waste, _allocated_size);
size_t tlab_used = Universe::heap()->tlab_used(thrd);
log.trace("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]"
" desired_size: " SIZE_FORMAT "KB"
" slow allocs: %d refill waste: " SIZE_FORMAT "B"
" alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB"
" slow: %dB fast: %dB",
" slow: %dB",
tag, p2i(thrd), thrd->osthread()->thread_id(),
_desired_size / (K / HeapWordSize),
_slow_allocations, _refill_waste_limit * HeapWordSize,
@ -311,8 +307,7 @@ void ThreadLocalAllocBuffer::print_stats(const char* tag) {
_allocation_fraction.average() * tlab_used / K,
_number_of_refills, waste_percent,
_gc_waste * HeapWordSize,
_slow_refill_waste * HeapWordSize,
_fast_refill_waste * HeapWordSize);
_slow_refill_waste * HeapWordSize);
}
void ThreadLocalAllocBuffer::set_sample_end(bool reset_byte_accumulation) {
@ -353,8 +348,6 @@ PerfVariable* ThreadLocalAllocStats::_perf_total_gc_waste;
PerfVariable* ThreadLocalAllocStats::_perf_max_gc_waste;
PerfVariable* ThreadLocalAllocStats::_perf_total_slow_refill_waste;
PerfVariable* ThreadLocalAllocStats::_perf_max_slow_refill_waste;
PerfVariable* ThreadLocalAllocStats::_perf_total_fast_refill_waste;
PerfVariable* ThreadLocalAllocStats::_perf_max_fast_refill_waste;
PerfVariable* ThreadLocalAllocStats::_perf_total_slow_allocations;
PerfVariable* ThreadLocalAllocStats::_perf_max_slow_allocations;
AdaptiveWeightedAverage ThreadLocalAllocStats::_allocating_threads_avg(0);
@ -378,8 +371,6 @@ void ThreadLocalAllocStats::initialize() {
_perf_max_gc_waste = create_perf_variable("maxGcWaste", PerfData::U_Bytes, CHECK);
_perf_total_slow_refill_waste = create_perf_variable("slowWaste", PerfData::U_Bytes, CHECK);
_perf_max_slow_refill_waste = create_perf_variable("maxSlowWaste", PerfData::U_Bytes, CHECK);
_perf_total_fast_refill_waste = create_perf_variable("fastWaste", PerfData::U_Bytes, CHECK);
_perf_max_fast_refill_waste = create_perf_variable("maxFastWaste", PerfData::U_Bytes, CHECK);
_perf_total_slow_allocations = create_perf_variable("slowAlloc", PerfData::U_None, CHECK);
_perf_max_slow_allocations = create_perf_variable("maxSlowAlloc", PerfData::U_None, CHECK);
}
@ -392,8 +383,6 @@ ThreadLocalAllocStats::ThreadLocalAllocStats() :
_total_allocations(0),
_total_gc_waste(0),
_max_gc_waste(0),
_total_fast_refill_waste(0),
_max_fast_refill_waste(0),
_total_slow_refill_waste(0),
_max_slow_refill_waste(0),
_total_slow_allocations(0),
@ -406,7 +395,6 @@ unsigned int ThreadLocalAllocStats::allocating_threads_avg() {
void ThreadLocalAllocStats::update_fast_allocations(unsigned int refills,
size_t allocations,
size_t gc_waste,
size_t fast_refill_waste,
size_t slow_refill_waste) {
_allocating_threads += 1;
_total_refills += refills;
@ -414,8 +402,6 @@ void ThreadLocalAllocStats::update_fast_allocations(unsigned int refills,
_total_allocations += allocations;
_total_gc_waste += gc_waste;
_max_gc_waste = MAX2(_max_gc_waste, gc_waste);
_total_fast_refill_waste += fast_refill_waste;
_max_fast_refill_waste = MAX2(_max_fast_refill_waste, fast_refill_waste);
_total_slow_refill_waste += slow_refill_waste;
_max_slow_refill_waste = MAX2(_max_slow_refill_waste, slow_refill_waste);
}
@ -432,8 +418,6 @@ void ThreadLocalAllocStats::update(const ThreadLocalAllocStats& other) {
_total_allocations += other._total_allocations;
_total_gc_waste += other._total_gc_waste;
_max_gc_waste = MAX2(_max_gc_waste, other._max_gc_waste);
_total_fast_refill_waste += other._total_fast_refill_waste;
_max_fast_refill_waste = MAX2(_max_fast_refill_waste, other._max_fast_refill_waste);
_total_slow_refill_waste += other._total_slow_refill_waste;
_max_slow_refill_waste = MAX2(_max_slow_refill_waste, other._max_slow_refill_waste);
_total_slow_allocations += other._total_slow_allocations;
@ -447,8 +431,6 @@ void ThreadLocalAllocStats::reset() {
_total_allocations = 0;
_total_gc_waste = 0;
_max_gc_waste = 0;
_total_fast_refill_waste = 0;
_max_fast_refill_waste = 0;
_total_slow_refill_waste = 0;
_max_slow_refill_waste = 0;
_total_slow_allocations = 0;
@ -462,18 +444,16 @@ void ThreadLocalAllocStats::publish() {
_allocating_threads_avg.sample(_allocating_threads);
const size_t waste = _total_gc_waste + _total_slow_refill_waste + _total_fast_refill_waste;
const size_t waste = _total_gc_waste + _total_slow_refill_waste;
const double waste_percent = percent_of(waste, _total_allocations);
log_debug(gc, tlab)("TLAB totals: thrds: %d refills: %d max: %d"
" slow allocs: %d max %d waste: %4.1f%%"
" gc: " SIZE_FORMAT "B max: " SIZE_FORMAT "B"
" slow: " SIZE_FORMAT "B max: " SIZE_FORMAT "B"
" fast: " SIZE_FORMAT "B max: " SIZE_FORMAT "B",
" slow: " SIZE_FORMAT "B max: " SIZE_FORMAT "B",
_allocating_threads, _total_refills, _max_refills,
_total_slow_allocations, _max_slow_allocations, waste_percent,
_total_gc_waste * HeapWordSize, _max_gc_waste * HeapWordSize,
_total_slow_refill_waste * HeapWordSize, _max_slow_refill_waste * HeapWordSize,
_total_fast_refill_waste * HeapWordSize, _max_fast_refill_waste * HeapWordSize);
_total_slow_refill_waste * HeapWordSize, _max_slow_refill_waste * HeapWordSize);
if (UsePerfData) {
_perf_allocating_threads ->set_value(_allocating_threads);
@ -484,8 +464,6 @@ void ThreadLocalAllocStats::publish() {
_perf_max_gc_waste ->set_value(_max_gc_waste);
_perf_total_slow_refill_waste ->set_value(_total_slow_refill_waste);
_perf_max_slow_refill_waste ->set_value(_max_slow_refill_waste);
_perf_total_fast_refill_waste ->set_value(_total_fast_refill_waste);
_perf_max_fast_refill_waste ->set_value(_max_fast_refill_waste);
_perf_total_slow_allocations ->set_value(_total_slow_allocations);
_perf_max_slow_allocations ->set_value(_max_slow_allocations);
}