JDK-8320162 : Obsolete UseCounterDecay
  • Type: CSR
  • Component: hotspot
  • Sub-Component: compiler
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 22
  • Submitted: 2023-11-15
  • Updated: 2023-11-20
  • Resolved: 2023-11-20
Related Reports
CSR :  
Relates :  
Description
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

Comments
Moving updated request back to Approved.
20-11-2023

Looks good to me too.
20-11-2023

Looks good.
20-11-2023

[~dlunden], sure; a CSR can be materially updated as long as the underlying bug hasn't been pushed yet. Change the state back to Draft, make the desired changes, then re-Finalize the request and I'll re-Approved it. HTH
16-11-2023

[~darcy] Is it possible/allowed to reopen and revise the CSR according to [~dholmes]'s suggestion?
16-11-2023

I was hoping to catch this before it was processed. As the flag is effectively obsolete then deprecation serves no purpose and we can move straight to obsoletion in 22 with removal in 23.
16-11-2023

Moving to Approved.
15-11-2023