8372625: [Linux] Remove unnecessary logic for supports_fast_thread_cpu_time - #620
8372625: [Linux] Remove unnecessary logic for supports_fast_thread_cpu_time#620mmm-choi wants to merge 2 commits into
Conversation
|
👋 Welcome back mmm-choi! A progress list of the required criteria for merging this PR into |
|
@mmm-choi This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 70 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@phohensee) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
This backport pull request has now been updated with issue from the original commit. |
Webrevs
|
|
|
|
/approval request Prerequisite for JDK-8372584 PR #621, which is the actual fix we want in 25 for the long-standing defect JDK-8210452. This PR is pure cleanup: it removes the now-unnecessary supports_fast_thread_cpu_time dual-path logic on Linux. Net code reduction, no behavior change, in mainline since JDK 26 with no regressions, and JDK-8372584 builds directly on it. |
|
|
/integrate |
|
/sponsor |
|
Going to push as commit 21d24d2.
Your commit was automatically rebased without conflicts. |
|
@phohensee @mmm-choi Pushed as commit 21d24d2. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
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
Reviewers
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