RFR: 8311557: [JVMCI] deadlock with JVMTI thread suspension [v2]

Doug Simon dnsimon at openjdk.org
Wed Aug 9 21:09:02 UTC 2023


On Wed, 9 Aug 2023 20:57:29 GMT, Tom Rodriguez <never at openjdk.org> wrote:

>> Java based JVMCI compiler threads are more like normal Java threads so they aren't `hidden_from_external_view` like the native compilers.  This can leak to deadlocks if you use JVMTI to suspend all threads since this will block the compiler queue and can block execution if background compilation is disabled.  It's reasonable to treat libgraal threads like native threads in this regard.  Making jargraal threads hidden too would interfere with using profiling and debugging tool on them so I've left that alone but it might be worth changing the JVMTI suspend and resume functions to explicitly skip compiler threads as well.
>
> Tom Rodriguez has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Refactor logic and add LibJVMCICompilerThreadHidden
>  - Merge branch 'master' into tkr-jvmci-hidden
>  - 8311557: [JVMCI] deadlock with JVMTI thread suspension

Marked as reviewed by dnsimon (Reviewer).

src/hotspot/share/compiler/abstractCompiler.hpp line 154:

> 152:   CompilerType type() const              { return _type; }
> 153: 
> 154:   virtual bool is_hidden_from_external_view() const { return false; }

It would be nice if this had a comment explaining what "hidden from external view" implies. But I see that `Thread::is_hidden_from_external_view` has no documentation either so I guess there's no much that can be explained here if the broader concept is somewhat undefined.

src/hotspot/share/jvmci/jvmciCompiler.hpp line 107:

> 105: 
> 106:   virtual bool is_hidden_from_external_view() const { return UseJVMCINativeLibrary && LibJVMCICompilerThreadHidden; }
> 107: 

Remove extra blank line.

src/hotspot/share/jvmci/jvmci_globals.hpp line 162:

> 160:   product(bool, LibJVMCICompilerThreadHidden, true, DIAGNOSTIC,             \
> 161:           "If true then native JVMCI compiler threads are hidden from "     \
> 162:           "JVMTI and FlightRecorder.  This must be set to false if you"     \

`you"` -> `you "`
`threads"` -> `threads."`

As far as I can help, this help text is never printed (is it?) but it may as well be properly formatted.

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

PR Review: https://git.openjdk.org/jdk/pull/14799#pullrequestreview-1570538234
PR Review Comment: https://git.openjdk.org/jdk/pull/14799#discussion_r1289186285
PR Review Comment: https://git.openjdk.org/jdk/pull/14799#discussion_r1289186899
PR Review Comment: https://git.openjdk.org/jdk/pull/14799#discussion_r1289189957


More information about the hotspot-compiler-dev mailing list