Skip to content
Permalink
Browse files
8234532: Remove ThreadLocalAllocBuffer::_fast_refill_waste since it i…
…s never set

Reviewed-by: tschatzl, sjohanss, pliden, sspitsyn
  • Loading branch information
albertnetymk committed May 19, 2021
1 parent 237fee8 commit 99fcc410a774e7b830856aa9c8e18e8a3b0567de
@@ -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,23 +292,22 @@ 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,
_allocation_fraction.average(),
_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,16 +395,13 @@ 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;
_max_refills = MAX2(_max_refills, 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);
}
@@ -63,7 +63,6 @@ class ThreadLocalAllocBuffer: public CHeapObj<mtThread> {
static unsigned _target_refills; // expected number of refills between GCs

unsigned _number_of_refills;
unsigned _fast_refill_waste;
unsigned _slow_refill_waste;
unsigned _gc_waste;
unsigned _slow_allocations;
@@ -106,8 +105,6 @@ class ThreadLocalAllocBuffer: public CHeapObj<mtThread> {
// statistics

int number_of_refills() const { return _number_of_refills; }
int fast_refill_waste() const { return _fast_refill_waste; }
int slow_refill_waste() const { return _slow_refill_waste; }
int gc_waste() const { return _gc_waste; }
int slow_allocations() const { return _slow_allocations; }

@@ -199,8 +196,6 @@ class ThreadLocalAllocStats : public StackObj {
static PerfVariable* _perf_max_gc_waste;
static PerfVariable* _perf_total_slow_refill_waste;
static PerfVariable* _perf_max_slow_refill_waste;
static PerfVariable* _perf_total_fast_refill_waste;
static PerfVariable* _perf_max_fast_refill_waste;
static PerfVariable* _perf_total_slow_allocations;
static PerfVariable* _perf_max_slow_allocations;

@@ -212,8 +207,6 @@ class ThreadLocalAllocStats : public StackObj {
size_t _total_allocations;
size_t _total_gc_waste;
size_t _max_gc_waste;
size_t _total_fast_refill_waste;
size_t _max_fast_refill_waste;
size_t _total_slow_refill_waste;
size_t _max_slow_refill_waste;
unsigned int _total_slow_allocations;
@@ -228,7 +221,6 @@ class ThreadLocalAllocStats : public StackObj {
void update_fast_allocations(unsigned int refills,
size_t allocations,
size_t gc_waste,
size_t fast_refill_waste,
size_t slow_refill_waste);
void update_slow_allocations(unsigned int allocations);
void update(const ThreadLocalAllocStats& other);
@@ -342,7 +342,6 @@
nonstatic_field(ThreadLocalAllocBuffer, _desired_size, size_t) \
nonstatic_field(ThreadLocalAllocBuffer, _refill_waste_limit, size_t) \
nonstatic_field(ThreadLocalAllocBuffer, _number_of_refills, unsigned) \
nonstatic_field(ThreadLocalAllocBuffer, _fast_refill_waste, unsigned) \
nonstatic_field(ThreadLocalAllocBuffer, _slow_allocations, unsigned) \
\
nonstatic_field(SafepointMechanism::ThreadData, _polling_word, volatile uintptr_t) \
@@ -408,7 +408,6 @@ 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, _fast_refill_waste, unsigned) \
nonstatic_field(ThreadLocalAllocBuffer, _slow_refill_waste, unsigned) \
nonstatic_field(ThreadLocalAllocBuffer, _gc_waste, unsigned) \
nonstatic_field(ThreadLocalAllocBuffer, _slow_allocations, unsigned) \
@@ -525,14 +525,10 @@ alias sun.gc.tlab.alloc // 1.5.0 b39
hotspot.gc.tlab.alloc // 1.5.0 b21
alias sun.gc.tlab.allocThreads // 1.5.0 b39
hotspot.gc.tlab.alloc_thrds // 1.5.0 b21
alias sun.gc.tlab.fastWaste // 1.5.0 b39
hotspot.gc.tlab.fastwaste // 1.5.0 b21
alias sun.gc.tlab.fills // 1.5.0 b39
hotspot.gc.tlab.fills // 1.5.0 b21
alias sun.gc.tlab.gcWaste // 1.5.0 b39
hotspot.gc.tlab.gcwaste // 1.5.0 b21
alias sun.gc.tlab.maxFastWaste // 1.5.0 b39
hotspot.gc.tlab.maxfastwaste // 1.5.0 b21
alias sun.gc.tlab.maxFills // 1.5.0 b39
hotspot.gc.tlab.maxfills // 1.5.0 b21
alias sun.gc.tlab.maxGcWaste // 1.5.0 b39

0 comments on commit 99fcc41

Please sign in to comment.