From 16df0907842af4729e72fe706c76681c8c799c03 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Mon, 26 Aug 2024 22:26:40 +0000 Subject: [PATCH] 8338947: Deprecate the UseLinuxPosixThreadCPUClocks flag and remove it in a future release Reviewed-by: kbarrett, stuefe --- src/hotspot/os/linux/globals_linux.hpp | 4 +--- src/hotspot/share/runtime/arguments.cpp | 3 +++ .../jtreg/runtime/CommandLine/VMDeprecatedOptions.java | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hotspot/os/linux/globals_linux.hpp b/src/hotspot/os/linux/globals_linux.hpp index 1cb0b553c52..90cb00fb7e6 100644 --- a/src/hotspot/os/linux/globals_linux.hpp +++ b/src/hotspot/os/linux/globals_linux.hpp @@ -38,10 +38,8 @@ product(bool, UseOprofile, false, \ "enable support for Oprofile profiler") \ \ - /* NB: The default value of UseLinuxPosixThreadCPUClocks may be */ \ - /* overridden in Arguments::parse_each_vm_init_arg. */ \ product(bool, UseLinuxPosixThreadCPUClocks, true, \ - "enable fast Linux Posix clocks where available") \ + "(Deprecated) enable fast Linux Posix clocks where available") \ \ product(bool, UseTransparentHugePages, false, \ "Use MADV_HUGEPAGE for large pages") \ diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index f4f3d30f3b8..0d0b58412ae 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -506,6 +506,9 @@ static SpecialFlag const special_jvm_flags[] = { { "RequireSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, { "UseSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, { "DontYieldALot", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) }, +#ifdef LINUX + { "UseLinuxPosixThreadCPUClocks", JDK_Version::jdk(24), JDK_Version::jdk(25), JDK_Version::jdk(26) }, +#endif { "LockingMode", JDK_Version::jdk(24), JDK_Version::jdk(26), JDK_Version::jdk(27) }, // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in: { "CreateMinidumpOnCrash", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() }, diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index 4e6252ae205..96bc22dfb1d 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -70,6 +70,9 @@ public class VMDeprecatedOptions { }) ); } + if (Platform.isLinux()) { + deprecated.add(new String[] { "UseLinuxPosixThreadCPUClocks", "true" }); + } if (wb.isJFRIncluded()) { deprecated.add(new String[] {"FlightRecorder", "false"}); }