From fc5fabfb0b00b763775c8a687ed0617668fb2bae Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Wed, 22 Apr 2026 19:02:47 +0000 Subject: [PATCH] 8382634: Remove redundant TLABRefillWasteFraction zero check Reviewed-by: tschatzl, phubner --- src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp | 6 +++++- src/hotspot/share/runtime/arguments.cpp | 8 -------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp index f9b8694eb04..59d7befb32d 100644 --- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp +++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp @@ -58,7 +58,11 @@ ThreadLocalAllocBuffer::ThreadLocalAllocBuffer() : // do nothing. TLABs must be inited by initialize() calls } -size_t ThreadLocalAllocBuffer::initial_refill_waste_limit() { return desired_size() / TLABRefillWasteFraction; } +size_t ThreadLocalAllocBuffer::initial_refill_waste_limit() { + assert(TLABRefillWasteFraction != 0, "inv"); + return desired_size() / TLABRefillWasteFraction; +} + size_t ThreadLocalAllocBuffer::min_size() { return align_object_size(MinTLABSize / HeapWordSize) + alignment_reserve(); } size_t ThreadLocalAllocBuffer::refill_waste_limit_increment() { return TLABWasteIncrement; } diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index d1304133d63..b8b32d89c65 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -1703,14 +1703,6 @@ bool Arguments::check_vm_args_consistency() { // Note: Needs platform-dependent factoring. bool status = true; - if (TLABRefillWasteFraction == 0) { - jio_fprintf(defaultStream::error_stream(), - "TLABRefillWasteFraction should be a denominator, " - "not %zu\n", - TLABRefillWasteFraction); - status = false; - } - status = CompilerConfig::check_args_consistency(status); #if INCLUDE_JVMCI if (status && EnableJVMCI) {