[jdk8u-dev] RFR: 8073464: GC workers do not have thread names
Volker Simonis
simonis at openjdk.org
Thu Nov 17 10:41:26 UTC 2022
This is a backport of "[JDK-8073464: GC workers do not have thread names](https://bugs.openjdk.org/browse/JDK-8073464)" which I request for parity with Oracle JDK 8 where it was downported to 8u351 (see [JDK-8285732](https://bugs.openjdk.org/browse/JDK-8285732)). This downport depends on "[JDK-6885993: Named Thread: introduce print() and print_on(outputStream* st) methods](https://bugs.openjdk.org/browse/JDK-6885993)" for which a [pull request already exists](https://github.com/openjdk/jdk8u-dev/pull/183).
Both of these changes are required to fix the native names of internal threads like for example GC threads. This does not only simplify debugging, but also helps observability tools. Finally, these two changes fix the "sun.management.HotspotInternal" MxBean which returns the "[InternalThreadCpuTimes](https://stackoverflow.com/questions/3947467/with-recent-sun-jvms-1-6-is-it-possible-to-get-gc-thread-information/4113407#4113407)". The "InternalThreadCpuTimes" attribute returns a map with a thread-name to thread-cpu-time mapping but is currently broken in JDK 8 because internal threads without native names (e.g. GC threads) are all mapped to the same entry (i.e. "Unknown").
The patch applies cleanly except for two copyright year mismatches in `concurrentGCThread.cpp` and `thread.hpp`. I've attached a diff of this patch compared to the original JDK 9 patch to this PR for your convenience (see [8073464-jdk8-vs-jdk9.txt](https://github.com/openjdk/jdk8u-dev/files/10030509/8073464-jdk8-vs-jdk9.txt))
-------------
Depends on: https://git.openjdk.org/jdk8u-dev/pull/183
Commit messages:
- 8073464: GC workers do not have thread names
Changes: https://git.openjdk.org/jdk8u-dev/pull/184/files
Webrev: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=184&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8073464
Stats: 16 lines in 7 files changed: 8 ins; 2 del; 6 mod
Patch: https://git.openjdk.org/jdk8u-dev/pull/184.diff
Fetch: git fetch https://git.openjdk.org/jdk8u-dev pull/184/head:pull/184
PR: https://git.openjdk.org/jdk8u-dev/pull/184
More information about the jdk8u-dev
mailing list