8372625: [Linux] Remove unnecessary logic for supports_fast_thread_cpu_time#620
Open
mmm-choi wants to merge 1 commit into
Open
8372625: [Linux] Remove unnecessary logic for supports_fast_thread_cpu_time#620mmm-choi wants to merge 1 commit into
mmm-choi wants to merge 1 commit into
Conversation
|
👋 Welcome back mmm-choi! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This backport pull request has now been updated with issue from the original commit. |
This was referenced Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Would like to get JDK-8372584 into 25u. This is dependent on this backport being integrated first.
This is the first of three related backports that together bring the Linux
getCurrentThreadUserTime()performance improvement to 25u. They must be applied in order:supports_fast_thread_cpu_timedual-path logic. Prerequisite./procparsing withclock_gettime. The actual optimization; depends on this PR.This PR is a pure refactoring/cleanup that removes the legacy "fast vs. slow" thread-CPU-time selection logic on Linux, which is dead weight on all currently supported kernels. It is a required base for JDK-8372584 (the function it introduces/renames here,
total_thread_cpu_time, is what JDK-8372584 builds on).Not a clean backport
This required manual conflict resolution. The conflict is not in the logic being changed. It arises because mainline commit (openjdk/jdk@a663812) JDK-8368124 ("Show useful thread names in ASAN reports"), which is not in 25u, had removed the adjacent
_pthread_setname_npmember.Resolution: retain
_pthread_setname_np(still used by 25u's dlsym-basedos::set_native_thread_name) and remove only_pthread_getcpuclockidand_supports_fast_thread_cpu_time, exactly as mainline does. The resulting thread-CPU-time code in os_linux.cppandos_linux.hpp` is byte-for-byte identical to mainline.Testing
Built
releaseon linux-x86_64 and linux-aarch64 (GCC 10.5, boot JDK 25).Ran the thread-CPU-time test set on the full 3-commit stack, all pass:
java/lang/management/ThreadMXBean/ThreadCpuTime.java,ThreadUserTime.java,VirtualThreads.javavmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime(10),isThreadCpuTimeSupported(5),isCurrentThreadCpuTimeSupported(5)jdk/jfr/event/runtime/TestThreadCpuTimeEvent.java,jdk/jfr/event/profiling/*(CPU-time sampler)Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk25u-dev.git pull/620/head:pull/620$ git checkout pull/620Update a local copy of the PR:
$ git checkout pull/620$ git pull https://git.openjdk.org/jdk25u-dev.git pull/620/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 620View PR using the GUI difftool:
$ git pr show -t 620Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk25u-dev/pull/620.diff
Using Webrev
Link to Webrev Comment