RFR: 8329109: Threads::print_on() tries to print CPU time for terminated GC threads [v2]

Richard Reingruber rrich at openjdk.org
Tue Apr 2 13:41:13 UTC 2024


On Tue, 2 Apr 2024 12:28:10 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

>> *EDIT 2024-04-02:* Use `Threads::non_java_threads_do(ThreadClosure* tc)` to print non-java threads (commit b2dabc95d760496d4896b30ef1a44cc5c250189d). It uses thread list iterators that synchronize with thread creation and termination. If a non-java thread is about to terminate, it waits for in progress iterations (see [NonJavaThread::remove_from_the_list](https://github.com/openjdk/jdk/blob/47f33a59eaaffc74881fcc9e29d13ff9b2538c2a/src/hotspot/share/runtime/nonJavaThread.cpp#L97-L102)).
>> 
>> Testing:
>> 
>> The output of a minimal example with G1 is almost identical (attached below). The order of non-java threads can differ.
>> 
>> More tests (besides GHA) are pending.
>
> Richard Reingruber has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Equivalent but simpler fix
>  - Revert
>    
>    This reverts commit 568a2bcc7a1c99ba9f95a33dbcb80eb511ead94b.

Thread dump of minimal example with G1.
Baseline: [thread_dump_baseline.txt](https://github.com/openjdk/jdk/files/14837376/thread_dump_baseline.txt)
PR: [thread_dump_pr.txt](https://github.com/openjdk/jdk/files/14837377/thread_dump_pr.txt)

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18518#issuecomment-2032071995


More information about the hotspot-gc-dev mailing list