8267468: Rename refill waster counters in ThreadLocalAllocBuffer

Reviewed-by: kbarrett, sspitsyn
This commit is contained in:
Albert Mingkun Yang 2021-05-26 06:50:23 +00:00
parent b33b8bc88d
commit 039441689d
4 changed files with 45 additions and 43 deletions

View file

@ -51,7 +51,7 @@ ThreadLocalAllocBuffer::ThreadLocalAllocBuffer() :
_allocated_before_last_gc(0),
_bytes_since_last_sample_point(0),
_number_of_refills(0),
_slow_refill_waste(0),
_refill_waste(0),
_gc_waste(0),
_slow_allocations(0),
_allocated_size(0),
@ -104,9 +104,9 @@ void ThreadLocalAllocBuffer::accumulate_and_reset_statistics(ThreadLocalAllocSta
stats->update_fast_allocations(_number_of_refills,
_allocated_size,
_gc_waste,
_slow_refill_waste);
_refill_waste);
} else {
assert(_number_of_refills == 0 && _slow_refill_waste == 0 && _gc_waste == 0,
assert(_number_of_refills == 0 && _refill_waste == 0 && _gc_waste == 0,
"tlab stats == 0");
}
@ -147,7 +147,7 @@ void ThreadLocalAllocBuffer::retire(ThreadLocalAllocStats* stats) {
}
void ThreadLocalAllocBuffer::retire_before_allocation() {
_slow_refill_waste += (unsigned int)remaining();
_refill_waste += (unsigned int)remaining();
retire();
}
@ -173,7 +173,7 @@ void ThreadLocalAllocBuffer::resize() {
void ThreadLocalAllocBuffer::reset_statistics() {
_number_of_refills = 0;
_slow_refill_waste = 0;
_refill_waste = 0;
_gc_waste = 0;
_slow_allocations = 0;
_allocated_size = 0;
@ -292,7 +292,7 @@ void ThreadLocalAllocBuffer::print_stats(const char* tag) {
}
Thread* thrd = thread();
size_t waste = _gc_waste + _slow_refill_waste;
size_t waste = _gc_waste + _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]"
@ -307,7 +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);
_refill_waste * HeapWordSize);
}
void ThreadLocalAllocBuffer::set_sample_end(bool reset_byte_accumulation) {
@ -346,8 +346,8 @@ PerfVariable* ThreadLocalAllocStats::_perf_max_refills;
PerfVariable* ThreadLocalAllocStats::_perf_total_allocations;
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_refill_waste;
PerfVariable* ThreadLocalAllocStats::_perf_max_refill_waste;
PerfVariable* ThreadLocalAllocStats::_perf_total_slow_allocations;
PerfVariable* ThreadLocalAllocStats::_perf_max_slow_allocations;
AdaptiveWeightedAverage ThreadLocalAllocStats::_allocating_threads_avg(0);
@ -369,8 +369,8 @@ void ThreadLocalAllocStats::initialize() {
_perf_total_allocations = create_perf_variable("alloc", PerfData::U_Bytes, CHECK);
_perf_total_gc_waste = create_perf_variable("gcWaste", PerfData::U_Bytes, CHECK);
_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_refill_waste = create_perf_variable("refillWaste", PerfData::U_Bytes, CHECK);
_perf_max_refill_waste = create_perf_variable("maxRefillWaste", 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);
}
@ -383,8 +383,8 @@ ThreadLocalAllocStats::ThreadLocalAllocStats() :
_total_allocations(0),
_total_gc_waste(0),
_max_gc_waste(0),
_total_slow_refill_waste(0),
_max_slow_refill_waste(0),
_total_refill_waste(0),
_max_refill_waste(0),
_total_slow_allocations(0),
_max_slow_allocations(0) {}
@ -395,15 +395,15 @@ unsigned int ThreadLocalAllocStats::allocating_threads_avg() {
void ThreadLocalAllocStats::update_fast_allocations(unsigned int refills,
size_t allocations,
size_t gc_waste,
size_t slow_refill_waste) {
size_t refill_waste) {
_allocating_threads += 1;
_total_refills += refills;
_max_refills = MAX2(_max_refills, refills);
_total_allocations += allocations;
_total_gc_waste += gc_waste;
_max_gc_waste = MAX2(_max_gc_waste, gc_waste);
_total_slow_refill_waste += slow_refill_waste;
_max_slow_refill_waste = MAX2(_max_slow_refill_waste, slow_refill_waste);
_total_refill_waste += refill_waste;
_max_refill_waste = MAX2(_max_refill_waste, refill_waste);
}
void ThreadLocalAllocStats::update_slow_allocations(unsigned int allocations) {
@ -418,8 +418,8 @@ 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_slow_refill_waste += other._total_slow_refill_waste;
_max_slow_refill_waste = MAX2(_max_slow_refill_waste, other._max_slow_refill_waste);
_total_refill_waste += other._total_refill_waste;
_max_refill_waste = MAX2(_max_refill_waste, other._max_refill_waste);
_total_slow_allocations += other._total_slow_allocations;
_max_slow_allocations = MAX2(_max_slow_allocations, other._max_slow_allocations);
}
@ -431,8 +431,8 @@ void ThreadLocalAllocStats::reset() {
_total_allocations = 0;
_total_gc_waste = 0;
_max_gc_waste = 0;
_total_slow_refill_waste = 0;
_max_slow_refill_waste = 0;
_total_refill_waste = 0;
_max_refill_waste = 0;
_total_slow_allocations = 0;
_max_slow_allocations = 0;
}
@ -444,7 +444,7 @@ void ThreadLocalAllocStats::publish() {
_allocating_threads_avg.sample(_allocating_threads);
const size_t waste = _total_gc_waste + _total_slow_refill_waste;
const size_t waste = _total_gc_waste + _total_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%%"
@ -453,7 +453,7 @@ void ThreadLocalAllocStats::publish() {
_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_refill_waste * HeapWordSize, _max_refill_waste * HeapWordSize);
if (UsePerfData) {
_perf_allocating_threads ->set_value(_allocating_threads);
@ -462,8 +462,8 @@ void ThreadLocalAllocStats::publish() {
_perf_total_allocations ->set_value(_total_allocations);
_perf_total_gc_waste ->set_value(_total_gc_waste);
_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_refill_waste ->set_value(_total_refill_waste);
_perf_max_refill_waste ->set_value(_max_refill_waste);
_perf_total_slow_allocations ->set_value(_total_slow_allocations);
_perf_max_slow_allocations ->set_value(_max_slow_allocations);
}

View file

@ -63,7 +63,7 @@ private:
static unsigned _target_refills; // expected number of refills between GCs
unsigned _number_of_refills;
unsigned _slow_refill_waste;
unsigned _refill_waste;
unsigned _gc_waste;
unsigned _slow_allocations;
size_t _allocated_size;
@ -194,8 +194,8 @@ private:
static PerfVariable* _perf_total_allocations;
static PerfVariable* _perf_total_gc_waste;
static PerfVariable* _perf_max_gc_waste;
static PerfVariable* _perf_total_slow_refill_waste;
static PerfVariable* _perf_max_slow_refill_waste;
static PerfVariable* _perf_total_refill_waste;
static PerfVariable* _perf_max_refill_waste;
static PerfVariable* _perf_total_slow_allocations;
static PerfVariable* _perf_max_slow_allocations;
@ -207,8 +207,8 @@ private:
size_t _total_allocations;
size_t _total_gc_waste;
size_t _max_gc_waste;
size_t _total_slow_refill_waste;
size_t _max_slow_refill_waste;
size_t _total_refill_waste;
size_t _max_refill_waste;
unsigned int _total_slow_allocations;
unsigned int _max_slow_allocations;
@ -221,7 +221,7 @@ public:
void update_fast_allocations(unsigned int refills,
size_t allocations,
size_t gc_waste,
size_t slow_refill_waste);
size_t refill_waste);
void update_slow_allocations(unsigned int allocations);
void update(const ThreadLocalAllocStats& other);

View file

@ -408,7 +408,7 @@ typedef HashtableEntry<InstanceKlass*, mtClass> KlassHashtableEntry;
static_field(ThreadLocalAllocBuffer, _reserve_for_allocation_prefetch, int) \
static_field(ThreadLocalAllocBuffer, _target_refills, unsigned) \
nonstatic_field(ThreadLocalAllocBuffer, _number_of_refills, unsigned) \
nonstatic_field(ThreadLocalAllocBuffer, _slow_refill_waste, unsigned) \
nonstatic_field(ThreadLocalAllocBuffer, _refill_waste, unsigned) \
nonstatic_field(ThreadLocalAllocBuffer, _gc_waste, unsigned) \
nonstatic_field(ThreadLocalAllocBuffer, _slow_allocations, unsigned) \
nonstatic_field(VirtualSpace, _low_boundary, char*) \

View file

@ -535,11 +535,13 @@ alias sun.gc.tlab.maxGcWaste // 1.5.0 b39
hotspot.gc.tlab.maxgcwaste // 1.5.0 b21
alias sun.gc.tlab.maxSlowAlloc // 1.5.0 b39
hotspot.gc.tlab.maxslowalloc // 1.5.0 b21
alias sun.gc.tlab.maxSlowWaste // 1.5.0 b39
alias sun.gc.tlab.maxRefillWaste // 17
sun.gc.tlab.maxSlowWaste // 1.5.0 b39
hotspot.gc.tlab.maxslowwaste // 1.5.0 b21
alias sun.gc.tlab.slowAlloc // 1.5.0 b39
hotspot.gc.tlab.slowalloc // 1.5.0 b21
alias sun.gc.tlab.slowWaste // 1.5.0 b39
alias sun.gc.tlab.refillWaste // 17
sun.gc.tlab.slowWaste // 1.5.0 b39
hotspot.gc.tlab.slowwaste // 1.5.0 b21
// sun.os