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

Stefan Karlsson stefank at openjdk.org
Wed Jan 18 09:24:14 UTC 2023


> 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

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11586/files
  - new: https://git.openjdk.org/jdk/pull/11586/files/b6566b2d..9fe191e2

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11586&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11586&range=00-01

  Stats: 38617 lines in 2044 files changed: 22568 ins; 8579 del; 7470 mod
  Patch: https://git.openjdk.org/jdk/pull/11586.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11586/head:pull/11586

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


More information about the hotspot-jfr-dev mailing list