RFR: 8326106: Write and clear stack trace table outside of safepoint

Markus Grönlund mgronlun at openjdk.org
Sun Feb 18 19:47:03 UTC 2024


Greetings,

When the chunk rotates, serializing the stack trace table happens in two passes:

1. The pre-safepoint writes as much as possible but does not delete nodes.
2. The safepoint writes new entries incrementally in addition to deleting nodes and resetting buckets.

Since a global lock protects the stack trace table, hoisting the deletes and clearing the table outside safepoints makes sense. Doing so will minimize the stack trace table work needed during the safepoint. The tradeoff is that an identical stack trace can be written twice. However, this is low risk because the pre-safepoint and the safepoint operations happen back to back (i.e. there is only a tiny window for inserting a new stack trace).

Testing: jdk_jfr, stress testing

Thanks
Markus

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

Commit messages:
 - 8326106

Changes: https://git.openjdk.org/jdk/pull/17905/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17905&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8326106
  Stats: 19 lines in 3 files changed: 5 ins; 8 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/17905.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17905/head:pull/17905

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


More information about the hotspot-jfr-dev mailing list