Summary
-------
Obsolete the no longer used flag UseCounterDecay and also schedule its expiration.
Problem
-------
The flag UseCounterDecay has no effect as of JDK-8251462.
Solution
--------
Obsolete UseCounterDecay in JDK 22 and expire it in JDK 23.
Specification
-------------
The relevant changes for this CSR:
```
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index c790a0022a4..a503e72d692 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -529,6 +529,7 @@ static SpecialFlag const special_jvm_flags[] = {
{ "RefDiscoveryPolicy", JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },
{ "MetaspaceReclaimPolicy", JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },
{ "DoReserveCopyInSuperWord", JDK_Version::undefined(), JDK_Version::jdk(22), JDK_Version::jdk(23) },
+ { "UseCounterDecay", JDK_Version::undefined(), JDK_Version::jdk(22), JDK_Version::jdk(23) },
#ifdef LINUX
{ "UseHugeTLBFS", JDK_Version::undefined(), JDK_Version::jdk(22), JDK_Version::jdk(23) },
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
index 17dfaee8a76..b780b040f94 100644
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -1220,16 +1220,9 @@ const int ObjectAlignmentInBytes = 8;
product(bool, UseCompiler, true, \
"Use Just-In-Time compilation") \
\
- product(bool, UseCounterDecay, true, \
- "Adjust recompilation counters") \
- \
develop(intx, CounterHalfLifeTime, 30, \
"Half-life time of invocation counters (in seconds)") \
\
```
Full PR for reference: https://github.com/openjdk/jdk/pull/16673