RFR: 8298377: JfrVframeStream causes deadlocks in ZGC [v2]

Markus Grönlund mgronlun at openjdk.org
Wed Jan 18 11:21:21 UTC 2023


On Wed, 18 Jan 2023 09:24:14 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> The JfrVFrameStream is used while generating stack traces for events. One of the events are the ZPage allocation event. This event is sometimes sent when ZGC is relocating. The current implementation of JfrVFrameStream uses WalkContinuation::include, which causes JFR to walk the continuation and perform GC barriers. This is problematic, since ZGC has a requirement that we never perform load barriers while running the relocation code. If we do, we might end up performing other reloctions from the the relocation code, and in some cases that causes dead locks.
>> 
>> I propose that JFR doesn't walk the continuations when sending events. An alternative could be to limit this to ZGC, but I'd like to get some feedback around that from JFR / Loom devs.
>> 
>> We've been testing this patch in the Generational ZGC repository.
>
> Stefan Karlsson 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 five additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'upstream/master' into 8298377_zgc_jfr_loom_deadlock
>  - Start stack watermark processing from JFR async profiler
>  - Only skip if stack watermark processing has not started
>  - Merge remote-tracking branch 'upstream/master' into 8298377_zgc_jfr_loom_deadlock
>  - 8298377: JfrVframeStream causes deadlocks in ZGC

Question: does the "start_processing()" call ever reach a malloc, directly or indirectly? If so, it is problematic to call from the sampler thread.

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

PR: https://git.openjdk.org/jdk/pull/11586


More information about the hotspot-jfr-dev mailing list