From aeafc5b1655858cd72de58e5f1c0b80b984d7274 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Fri, 20 Feb 2026 12:41:34 +0000 Subject: [PATCH] 8378245: Obsolete ParallelRefProcBalancingEnabled Reviewed-by: jsikstro, dholmes, tschatzl --- src/hotspot/share/gc/shared/gc_globals.hpp | 3 --- .../share/gc/shared/referenceProcessor.cpp | 26 +------------------ .../share/gc/shared/referenceProcessor.hpp | 1 - src/hotspot/share/runtime/arguments.cpp | 2 +- 4 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/hotspot/share/gc/shared/gc_globals.hpp b/src/hotspot/share/gc/shared/gc_globals.hpp index 6aa1fcf066b..8e1073db022 100644 --- a/src/hotspot/share/gc/shared/gc_globals.hpp +++ b/src/hotspot/share/gc/shared/gc_globals.hpp @@ -202,9 +202,6 @@ "(Deprecated) Enable parallel reference processing " \ "whenever possible") \ \ - product(bool, ParallelRefProcBalancingEnabled, true, \ - "(Deprecated) Enable balancing of reference processing queues") \ - \ product(size_t, ReferencesPerThread, 1000, EXPERIMENTAL, \ "Ergonomically start one thread for this amount of " \ "references for reference processing if " \ diff --git a/src/hotspot/share/gc/shared/referenceProcessor.cpp b/src/hotspot/share/gc/shared/referenceProcessor.cpp index 0153ee13287..bff097711ca 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp @@ -586,33 +586,9 @@ void ReferenceProcessor::set_active_mt_degree(uint v) { _next_id = 0; } -bool ReferenceProcessor::need_balance_queues(DiscoveredList refs_lists[]) { - assert(processing_is_mt(), "why balance non-mt processing?"); - // _num_queues is the processing degree. Only list entries up to - // _num_queues will be processed, so any non-empty lists beyond - // that must be redistributed to lists in that range. Even if not - // needed for that, balancing may be desirable to eliminate poor - // distribution of references among the lists. - if (ParallelRefProcBalancingEnabled) { - return true; // Configuration says do it. - } else { - // Configuration says don't balance, but if there are non-empty - // lists beyond the processing degree, then must ignore the - // configuration and balance anyway. - for (uint i = _num_queues; i < _max_num_queues; ++i) { - if (!refs_lists[i].is_empty()) { - return true; // Must balance despite configuration. - } - } - return false; // Safe to obey configuration and not balance. - } -} - void ReferenceProcessor::maybe_balance_queues(DiscoveredList refs_lists[]) { assert(processing_is_mt(), "Should not call this otherwise"); - if (need_balance_queues(refs_lists)) { - balance_queues(refs_lists); - } + balance_queues(refs_lists); } // Balances reference queues. diff --git a/src/hotspot/share/gc/shared/referenceProcessor.hpp b/src/hotspot/share/gc/shared/referenceProcessor.hpp index b211b94a85d..67bf3d7de36 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.hpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.hpp @@ -366,7 +366,6 @@ private: // Balances reference queues. void balance_queues(DiscoveredList refs_lists[]); - bool need_balance_queues(DiscoveredList refs_lists[]); // If there is need to balance the given queue, do it. void maybe_balance_queues(DiscoveredList refs_lists[]); diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 546ae610769..c87be03ad0c 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -537,7 +537,6 @@ static SpecialFlag const special_jvm_flags[] = { { "UseCompressedClassPointers", JDK_Version::jdk(25), JDK_Version::jdk(27), JDK_Version::undefined() }, #endif { "ParallelRefProcEnabled", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, - { "ParallelRefProcBalancingEnabled", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, { "MaxRAM", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, { "AggressiveHeap", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, { "NeverActAsServerClassMachine", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, @@ -553,6 +552,7 @@ static SpecialFlag const special_jvm_flags[] = { #endif { "PSChunkLargeArrays", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, + { "ParallelRefProcBalancingEnabled", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, #ifdef ASSERT { "DummyObsoleteTestFlag", JDK_Version::undefined(), JDK_Version::jdk(18), JDK_Version::undefined() },